comparison h264.c @ 10234:c2fc56bdee95 libavcodec

Check num_units_in_tick/time_scale to be valid and within the range we support. based on a patch by chrome
author michael
date Wed, 23 Sep 2009 09:58:44 +0000
parents 9a670cfd1941
children 14353a40db5e
comparison
equal deleted inserted replaced
10233:f397ad0fa67d 10234:c2fc56bdee95
7085 7085
7086 sps->timing_info_present_flag = get_bits1(&s->gb); 7086 sps->timing_info_present_flag = get_bits1(&s->gb);
7087 if(sps->timing_info_present_flag){ 7087 if(sps->timing_info_present_flag){
7088 sps->num_units_in_tick = get_bits_long(&s->gb, 32); 7088 sps->num_units_in_tick = get_bits_long(&s->gb, 32);
7089 sps->time_scale = get_bits_long(&s->gb, 32); 7089 sps->time_scale = get_bits_long(&s->gb, 32);
7090 if(sps->num_units_in_tick-1 > 0x7FFFFFFEU || sps->time_scale-1 > 0x7FFFFFFEU){
7091 av_log(h->s.avctx, AV_LOG_ERROR, "time_scale/num_units_in_tick inavlid or unsupported (%d/%d)\n", sps->time_scale, sps->num_units_in_tick);
7092 return -1;
7093 }
7090 sps->fixed_frame_rate_flag = get_bits1(&s->gb); 7094 sps->fixed_frame_rate_flag = get_bits1(&s->gb);
7091 } 7095 }
7092 7096
7093 sps->nal_hrd_parameters_present_flag = get_bits1(&s->gb); 7097 sps->nal_hrd_parameters_present_flag = get_bits1(&s->gb);
7094 if(sps->nal_hrd_parameters_present_flag) 7098 if(sps->nal_hrd_parameters_present_flag)