minor simplification
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 26 Dec 2008 15:21:48 +0000 (15:21 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 26 Dec 2008 15:21:48 +0000 (15:21 +0000)
Originally committed as revision 16333 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/faxcompr.c

index ec6b9e0..6277512 100644 (file)
@@ -196,11 +196,11 @@ static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
                 }
                 *runs++ = run + saved_run;
                 saved_run = 0;
-                if(pix_left < run){
+                pix_left -= run;
+                if(pix_left < 0){
                     av_log(avctx, AV_LOG_ERROR, "Run went out of bounds\n");
                     return -1;
                 }
-                pix_left -= run;
                 offs += run;
                 mode = !mode;
             }