Skip to content
Snippets Groups Projects
Commit 11c5999e authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

Fix another sechole.

Originally committed as revision 16344 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 2a522579
No related branches found
No related tags found
No related merge requests found
...@@ -123,9 +123,10 @@ av_cold void ff_ccitt_unpack_init() ...@@ -123,9 +123,10 @@ av_cold void ff_ccitt_unpack_init()
static int decode_group3_1d_line(AVCodecContext *avctx, GetBitContext *gb, 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; unsigned int t;
for(;;){ for(;;){
t = get_vlc2(gb, ccitt_vlc[mode].table, 9, 2); t = get_vlc2(gb, ccitt_vlc[mode].table, 9, 2);
...@@ -136,14 +137,13 @@ static int decode_group3_1d_line(AVCodecContext *avctx, GetBitContext *gb, ...@@ -136,14 +137,13 @@ static int decode_group3_1d_line(AVCodecContext *avctx, GetBitContext *gb,
av_log(avctx, AV_LOG_ERROR, "Run overrun\n"); av_log(avctx, AV_LOG_ERROR, "Run overrun\n");
return -1; return -1;
} }
pix_left -= run; if(pix_left <= run){
if(pix_left <= 0){ if(pix_left == run)
if(!pix_left)
break; break;
runs[-1] += pix_left;
av_log(avctx, AV_LOG_ERROR, "Run went out of bounds\n"); av_log(avctx, AV_LOG_ERROR, "Run went out of bounds\n");
return -1; return -1;
} }
pix_left -= run;
run = 0; run = 0;
mode = !mode; mode = !mode;
}else if((int)t == -1){ }else if((int)t == -1){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment