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
1 changed files with 6 additions and 0 deletions

View File

@ -1146,6 +1146,12 @@ static int decode_seq_header(AVSContext *h)
skip_bits(&h->gb, 3); //sample_precision skip_bits(&h->gb, 3); //sample_precision
h->aspect_ratio = get_bits(&h->gb, 4); h->aspect_ratio = get_bits(&h->gb, 4);
frame_rate_code = 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_bits(&h->gb, 18); //bit_rate_lower
skip_bits1(&h->gb); //marker_bit skip_bits1(&h->gb); //marker_bit
skip_bits(&h->gb, 12); //bit_rate_upper skip_bits(&h->gb, 12); //bit_rate_upper