comparison h264.c @ 6017:e1404acccac3 libavcodec

Actually return with an error condition if we're being asked to deal with too many reference frames. Also check max num ref frames against our internal ref buffer sizes. Part of fix for roundup issue 281
author heydowns
date Fri, 14 Dec 2007 05:48:27 +0000
parents 5455f4e43948
children 9d1654835629
comparison
equal deleted inserted replaced
6016:5455f4e43948 6017:e1404acccac3
7208 av_log(h->s.avctx, AV_LOG_ERROR, "illegal POC type %d\n", sps->poc_type); 7208 av_log(h->s.avctx, AV_LOG_ERROR, "illegal POC type %d\n", sps->poc_type);
7209 return -1; 7209 return -1;
7210 } 7210 }
7211 7211
7212 tmp= get_ue_golomb(&s->gb); 7212 tmp= get_ue_golomb(&s->gb);
7213 if(tmp > MAX_PICTURE_COUNT-2){ 7213 if(tmp > MAX_PICTURE_COUNT-2 || tmp >= 32){
7214 av_log(h->s.avctx, AV_LOG_ERROR, "too many reference frames\n"); 7214 av_log(h->s.avctx, AV_LOG_ERROR, "too many reference frames\n");
7215 return -1;
7215 } 7216 }
7216 sps->ref_frame_count= tmp; 7217 sps->ref_frame_count= tmp;
7217 sps->gaps_in_frame_num_allowed_flag= get_bits1(&s->gb); 7218 sps->gaps_in_frame_num_allowed_flag= get_bits1(&s->gb);
7218 mb_width= get_ue_golomb(&s->gb) + 1; 7219 mb_width= get_ue_golomb(&s->gb) + 1;
7219 mb_height= get_ue_golomb(&s->gb) + 1; 7220 mb_height= get_ue_golomb(&s->gb) + 1;