[FFmpeg-cvslog] r18732 - trunk/libavcodec/wavpack.c

kostya subversion
Sun May 3 07:42:52 CEST 2009


Author: kostya
Date: Sun May  3 07:42:51 2009
New Revision: 18732

Log:
Check whether extra bits block has enough data.
Patch by Laurent Aimar "f\145nr\151r >at< vide\157lan <dot> o\162g"

Modified:
   trunk/libavcodec/wavpack.c

Modified: trunk/libavcodec/wavpack.c
==============================================================================
--- trunk/libavcodec/wavpack.c	Sat May  2 11:12:03 2009	(r18731)
+++ trunk/libavcodec/wavpack.c	Sun May  3 07:42:51 2009	(r18732)
@@ -795,6 +795,14 @@ static int wavpack_decode_frame(AVCodecC
         av_log(avctx, AV_LOG_ERROR, "Packed samples not found\n");
         return -1;
     }
+    if(s->got_extra_bits){
+        const int size = s->gb_extra_bits.size_in_bits - get_bits_count(&s->gb_extra_bits);
+        const int wanted = s->samples * s->extra_bits << s->stereo_in;
+        if(size < wanted){
+            av_log(avctx, AV_LOG_ERROR, "Too small EXTRABITS\n");
+            s->got_extra_bits = 0;
+        }
+    }
 
     if(s->stereo_in){
         if(bpp == 2)



More information about the ffmpeg-cvslog mailing list