[FFmpeg-cvslog] r21521 - trunk/libavcodec/vp56.c

aurel subversion
Fri Jan 29 00:49:46 CET 2010


Author: aurel
Date: Fri Jan 29 00:49:46 2010
New Revision: 21521

Log:
vp56: check buffer size to fix a potential segfault
patch by Laurent Aimar  fenrir _at_ videolan _dot_ org

Modified:
   trunk/libavcodec/vp56.c

Modified: trunk/libavcodec/vp56.c
==============================================================================
--- trunk/libavcodec/vp56.c	Fri Jan 29 00:30:24 2010	(r21520)
+++ trunk/libavcodec/vp56.c	Fri Jan 29 00:49:46 2010	(r21521)
@@ -504,8 +504,12 @@ int vp56_decode_frame(AVCodecContext *av
     int is_alpha, av_uninit(alpha_offset);
 
     if (s->has_alpha) {
+        if (remaining_buf_size < 3)
+            return -1;
         alpha_offset = bytestream_get_be24(&buf);
         remaining_buf_size -= 3;
+        if (remaining_buf_size < alpha_offset)
+            return -1;
     }
 
     for (is_alpha=0; is_alpha < 1+s->has_alpha; is_alpha++) {



More information about the ffmpeg-cvslog mailing list