comparison h264.c @ 4270:758ba4a18478 libavcodec

fix crash when decoding a truncated H264 slice patch by Alexander Chemeris % ipse P ffmpeg A gmail.com % Original thread: date: Dec 5, 2006 7:26 PM subject: [Ffmpeg-devel] [PATCH] Fix crush when truncated slice passed to H.264 decoder
author gpoirier
date Tue, 05 Dec 2006 22:18:19 +0000
parents c37ea749711e
children 8cb3d28d7e40
comparison
equal deleted inserted replaced
4269:c37ea749711e 4270:758ba4a18478
4881 4881
4882 //FIXME set last_non_zero? 4882 //FIXME set last_non_zero?
4883 4883
4884 if(total_coeff==0) 4884 if(total_coeff==0)
4885 return 0; 4885 return 0;
4886 if(total_coeff<0) {
4887 av_log(h->s.avctx, AV_LOG_ERROR, "corrupted macroblock %d %d (total_coeff<0)\n", s->mb_x, s->mb_y);
4888 return -1;
4889 }
4886 4890
4887 trailing_ones= coeff_token&3; 4891 trailing_ones= coeff_token&3;
4888 tprintf("trailing:%d, total:%d\n", trailing_ones, total_coeff); 4892 tprintf("trailing:%d, total:%d\n", trailing_ones, total_coeff);
4889 assert(total_coeff<=16); 4893 assert(total_coeff<=16);
4890 4894