comparison mpeg12.c @ 6492:9fc086c22693 libavcodec

do not fail badly if aspect ratio is 0/forbidden, fix issue 369
author bcoudurier
date Thu, 13 Mar 2008 18:26:53 +0000
parents 493dc59d469a
children bed080a7ccbd
comparison
equal deleted inserted replaced
6491:c8c58c35feef 6492:9fc086c22693
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 return -1;
1975 s->frame_rate_index = get_bits(&s->gb, 4); 1973 s->frame_rate_index = get_bits(&s->gb, 4);
1976 if (s->frame_rate_index == 0 || s->frame_rate_index > 13) 1974 if (s->frame_rate_index == 0 || s->frame_rate_index > 13)
1977 return -1; 1975 return -1;
1978 s->bit_rate = get_bits(&s->gb, 18) * 400; 1976 s->bit_rate = get_bits(&s->gb, 18) * 400;
1979 if (get_bits1(&s->gb) == 0) /* marker */ 1977 if (get_bits1(&s->gb) == 0) /* marker */