faxcompr: fix out of array read
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 7 Sep 2012 10:35:41 +0000 (12:35 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 7 Sep 2012 10:36:00 +0000 (12:36 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/faxcompr.c

index 5aa7885..e7f9d00 100644 (file)
@@ -228,7 +228,7 @@ static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
             mode = !mode;
         }
         //sync line pointers
-        while(run_off <= offs){
+        while(offs < width && run_off <= offs){
             run_off += *ref++;
             run_off += *ref++;
         }