]> git.sesse.net Git - ffmpeg/commitdiff
vmdaudio: set *data_size to zero when skipping small packets and add a warning log...
authorJustin Ruggles <justin.ruggles@gmail.com>
Wed, 23 Feb 2011 18:11:06 +0000 (13:11 -0500)
committerRonald S. Bultje <rsbultje@gmail.com>
Thu, 24 Feb 2011 02:11:36 +0000 (21:11 -0500)
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
libavcodec/vmdav.c

index b338da39042f8db3120a01bdc8dc53437da1187e..1407c965886ed7a036ea3c4617d9681dedac3d3c 100644 (file)
@@ -514,8 +514,11 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx,
     /* point to the start of the encoded data */
     const unsigned char *p = buf + 16;
 
-    if (buf_size < 16)
+    if (buf_size < 16) {
+        av_log(avctx, AV_LOG_WARNING, "skipping small junk packet\n");
+        *data_size = 0;
         return buf_size;
+    }
 
     block_type = buf[6];
     if (block_type < BLOCK_TYPE_AUDIO || block_type > BLOCK_TYPE_SILENCE) {