[FFmpeg-cvslog] r16345 - trunk/libavcodec/faxcompr.c

michael subversion
Fri Dec 26 19:06:29 CET 2008


Author: michael
Date: Fri Dec 26 19:06:29 2008
New Revision: 16345

Log:
Fix yet another sechole.

Modified:
   trunk/libavcodec/faxcompr.c

Modified: trunk/libavcodec/faxcompr.c
==============================================================================
--- trunk/libavcodec/faxcompr.c	Fri Dec 26 18:51:10 2008	(r16344)
+++ trunk/libavcodec/faxcompr.c	Fri Dec 26 19:06:29 2008	(r16345)
@@ -156,10 +156,11 @@ static int decode_group3_1d_line(AVCodec
 }
 
 static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
-                                 int width, int *runs, const int *runend, const int *ref)
+                                 unsigned int width, int *runs, const int *runend, const int *ref)
 {
-    int mode = 0, offs = 0, run = 0, saved_run = 0, t;
+    int mode = 0, saved_run = 0, t;
     int run_off = *ref++;
+    unsigned int offs=0, run= 0;
 
     runend--; // for the last written 0
 
@@ -200,7 +201,7 @@ static int decode_group3_2d_line(AVCodec
                 }
                 saved_run = 0;
                 offs += run;
-                if(offs > width){
+                if(offs > width || run > width){
                     av_log(avctx, AV_LOG_ERROR, "Run went out of bounds\n");
                     return -1;
                 }




More information about the ffmpeg-cvslog mailing list