1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/cavsdec: Check frame_rate_code

Fixes CID1239111 part1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-05-14 18:00:09 +02:00
parent 139e1c8009
commit c5c06e392b

View File

@ -1146,6 +1146,12 @@ static int decode_seq_header(AVSContext *h)
skip_bits(&h->gb, 3); //sample_precision
h->aspect_ratio = get_bits(&h->gb, 4);
frame_rate_code = get_bits(&h->gb, 4);
if (frame_rate_code == 0 || frame_rate_code > 13) {
av_log(h->avctx, AV_LOG_WARNING,
"frame_rate_code %d is invalid\n", frame_rate_code);
frame_rate_code = 1;
}
skip_bits(&h->gb, 18); //bit_rate_lower
skip_bits1(&h->gb); //marker_bit
skip_bits(&h->gb, 12); //bit_rate_upper