]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/rv30.c
x86: Remove duplicated AVG_3DNOW_OP / AVG_MMX2_OP macros from h264_qpel_mmx.c.
[ffmpeg] / libavcodec / rv30.c
index 5d7109f961410f74b547fd4892bf1fc0affdc18d..1bb223cd7bfc11b148bd1cff9575562b11f6c61e 100644 (file)
@@ -103,7 +103,7 @@ static int rv30_decode_mb_info(RV34DecContext *r)
     GetBitContext *gb = &s->gb;
     int code = svq3_get_ue_golomb(gb);
 
-    if(code > 11){
+    if (code < 0 || code > 11) {
         av_log(s->avctx, AV_LOG_ERROR, "Incorrect MB type code\n");
         return -1;
     }
@@ -256,6 +256,7 @@ static av_cold int rv30_decode_init(AVCodecContext *avctx)
     if(avctx->extradata_size - 8 < (r->rpr - 1) * 2){
         av_log(avctx, AV_LOG_ERROR, "Insufficient extradata - need at least %d bytes, got %d\n",
                6 + r->rpr * 2, avctx->extradata_size);
+        return AVERROR(EINVAL);
     }
     r->parse_slice_header = rv30_parse_slice_header;
     r->decode_intra_types = rv30_decode_intra_types;
@@ -267,16 +268,17 @@ static av_cold int rv30_decode_init(AVCodecContext *avctx)
 }
 
 AVCodec ff_rv30_decoder = {
-    "rv30",
-    AVMEDIA_TYPE_VIDEO,
-    CODEC_ID_RV30,
-    sizeof(RV34DecContext),
-    rv30_decode_init,
-    NULL,
-    ff_rv34_decode_end,
-    ff_rv34_decode_frame,
-    CODEC_CAP_DR1 | CODEC_CAP_DELAY,
-    .flush = ff_mpeg_flush,
-    .long_name = NULL_IF_CONFIG_SMALL("RealVideo 3.0"),
-    .pix_fmts= ff_pixfmt_list_420,
+    .name           = "rv30",
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = CODEC_ID_RV30,
+    .priv_data_size = sizeof(RV34DecContext),
+    .init           = rv30_decode_init,
+    .close          = ff_rv34_decode_end,
+    .decode         = ff_rv34_decode_frame,
+    .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_FRAME_THREADS,
+    .flush          = ff_mpeg_flush,
+    .long_name      = NULL_IF_CONFIG_SMALL("RealVideo 3.0"),
+    .pix_fmts       = ff_pixfmt_list_420,
+    .init_thread_copy      = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_init_thread_copy),
+    .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_rv34_decode_update_thread_context),
 };