diff --git a/libavcodec/faxcompr.c b/libavcodec/faxcompr.c index 5aa7885679..e7f9d00a11 100644 --- a/libavcodec/faxcompr.c +++ b/libavcodec/faxcompr.c @@ -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++; }