aboutsummaryrefslogtreecommitdiff
path: root/libavcodec/faxcompr.c
diff options
context:
space:
mode:
authorMichael Niedermayer2008-12-26 17:51:10 +0000
committerMichael Niedermayer2008-12-26 17:51:10 +0000
commit11c5999e20c49e0f26af8bb8c60214da1f308ab3 (patch)
treecca094351a3ce2515693f9d9bfcd6cb517d5b511 /libavcodec/faxcompr.c
parent2a522579aa5753cf87a6a336150161e42c25a0aa (diff)
Fix another sechole.
Originally committed as revision 16344 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/faxcompr.c')
-rw-r--r--libavcodec/faxcompr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/faxcompr.c b/libavcodec/faxcompr.c
index 052ed25f43..54428e7d8c 100644
--- a/libavcodec/faxcompr.c
+++ b/libavcodec/faxcompr.c
@@ -123,9 +123,10 @@ av_cold void ff_ccitt_unpack_init()
static int decode_group3_1d_line(AVCodecContext *avctx, GetBitContext *gb,
- int pix_left, int *runs, const int *runend)
+ unsigned int pix_left, int *runs, const int *runend)
{
- int mode = 0, run = 0;
+ int mode = 0;
+ unsigned int run=0;
unsigned int t;
for(;;){
t = get_vlc2(gb, ccitt_vlc[mode].table, 9, 2);
@@ -136,14 +137,13 @@ static int decode_group3_1d_line(AVCodecContext *avctx, GetBitContext *gb,
av_log(avctx, AV_LOG_ERROR, "Run overrun\n");
return -1;
}
- pix_left -= run;
- if(pix_left <= 0){
- if(!pix_left)
+ if(pix_left <= run){
+ if(pix_left == run)
break;
- runs[-1] += pix_left;
av_log(avctx, AV_LOG_ERROR, "Run went out of bounds\n");
return -1;
}
+ pix_left -= run;
run = 0;
mode = !mode;
}else if((int)t == -1){