# HG changeset patch # User michael # Date 1246480237 0 # Node ID fe4e6d8242d4d06fe355ada11492055530115e3f # Parent f3ff182e9ecf5f00462767de4b4f7f82d1fd6c63 Make sure we dont read over the end. Fixes issue1237. diff -r f3ff182e9ecf -r fe4e6d8242d4 huffyuv.c --- a/huffyuv.c Wed Jul 01 17:48:22 2009 +0000 +++ b/huffyuv.c Wed Jul 01 20:30:37 2009 +0000 @@ -729,10 +729,17 @@ count/=2; + if(count >= (s->gb.size_in_bits - get_bits_count(&s->gb))/(31*4)){ + for(i=0; igb) < s->gb.size_in_bits; i++){ + READ_2PIX(s->temp[0][2*i ], s->temp[1][i], 1); + READ_2PIX(s->temp[0][2*i+1], s->temp[2][i], 2); + } + }else{ for(i=0; itemp[0][2*i ], s->temp[1][i], 1); READ_2PIX(s->temp[0][2*i+1], s->temp[2][i], 2); } + } } static void decode_gray_bitstream(HYuvContext *s, int count){ @@ -740,9 +747,15 @@ count/=2; + if(count >= (s->gb.size_in_bits - get_bits_count(&s->gb))/(31*2)){ + for(i=0; igb) < s->gb.size_in_bits; i++){ + READ_2PIX(s->temp[0][2*i ], s->temp[0][2*i+1], 0); + } + }else{ for(i=0; itemp[0][2*i ], s->temp[0][2*i+1], 0); } + } } #if CONFIG_HUFFYUV_ENCODER || CONFIG_FFVHUFF_ENCODER