comparison mpeg12.c @ 6493:bed080a7ccbd libavcodec

log aspect ratio forbidden value, and fail if error resilience is high
author bcoudurier
date Fri, 14 Mar 2008 09:33:38 +0000
parents 9fc086c22693
children 1144fc79b912
comparison
equal deleted inserted replaced
6492:9fc086c22693 6493:bed080a7ccbd
1968 height = get_bits(&s->gb, 12); 1968 height = get_bits(&s->gb, 12);
1969 if (width <= 0 || height <= 0 || 1969 if (width <= 0 || height <= 0 ||
1970 (width % 2) != 0 || (height % 2) != 0) 1970 (width % 2) != 0 || (height % 2) != 0)
1971 return -1; 1971 return -1;
1972 s->aspect_ratio_info= get_bits(&s->gb, 4); 1972 s->aspect_ratio_info= get_bits(&s->gb, 4);
1973 if (s->aspect_ratio_info == 0) {
1974 av_log(avctx, AV_LOG_ERROR, "aspect ratio has forbidden 0 value\n");
1975 if (avctx->error_resilience >= FF_ER_COMPLIANT)
1976 return -1;
1977 }
1973 s->frame_rate_index = get_bits(&s->gb, 4); 1978 s->frame_rate_index = get_bits(&s->gb, 4);
1974 if (s->frame_rate_index == 0 || s->frame_rate_index > 13) 1979 if (s->frame_rate_index == 0 || s->frame_rate_index > 13)
1975 return -1; 1980 return -1;
1976 s->bit_rate = get_bits(&s->gb, 18) * 400; 1981 s->bit_rate = get_bits(&s->gb, 18) * 400;
1977 if (get_bits1(&s->gb) == 0) /* marker */ 1982 if (get_bits1(&s->gb) == 0) /* marker */