]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/svq1dec.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavcodec / svq1dec.c
index cb89b3f61991cce3009e03a5cd68e447e0030d5f..c36f9fe43514f9410e4d9c5fe521971d5d7dda2a 100644 (file)
@@ -647,6 +647,9 @@ static int svq1_decode_frame(AVCodecContext *avctx,
   if (s->f_code != 0x20) {
     uint32_t *src = (uint32_t *) (buf + 4);
 
+    if (buf_size < 36)
+        return AVERROR_INVALIDDATA;
+
     for (i=0; i < 4; i++) {
       src[i] = ((src[i] << 16) | (src[i] >> 16)) ^ src[7 - i];
     }
@@ -706,7 +709,7 @@ static int svq1_decode_frame(AVCodecContext *avctx,
           result = svq1_decode_block_intra (&s->gb, &current[x], linesize);
           if (result != 0)
           {
-            av_log(s->avctx, AV_LOG_INFO, "Error in svq1_decode_block %i (keyframe)\n",result);
+            av_log(s->avctx, AV_LOG_ERROR, "Error in svq1_decode_block %i (keyframe)\n",result);
             goto err;
           }
         }
@@ -735,7 +738,7 @@ static int svq1_decode_frame(AVCodecContext *avctx,
     }
   }
 
-  *pict = *(AVFrame*)&s->current_picture;
+  *pict = s->current_picture.f;
 
 
   ff_MPV_frame_end(s);
@@ -818,7 +821,7 @@ AVCodec ff_svq1_decoder = {
     .close          = svq1_decode_end,
     .decode         = svq1_decode_frame,
     .capabilities   = CODEC_CAP_DR1,
-    .flush= ff_mpeg_flush,
-    .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV410P, PIX_FMT_NONE},
-    .long_name= NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
+    .flush          = ff_mpeg_flush,
+    .pix_fmts       = (const enum PixelFormat[]){ PIX_FMT_YUV410P, PIX_FMT_NONE },
+    .long_name      = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
 };