1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-07-22 04:04:14 +02:00

avcodec/mpeg12dec: Print error/warning messages on issues in mpeg1_decode_sequence()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-11-20 15:08:18 +01:00
parent e39f8fad32
commit 88b4c1a731

View File

@ -2121,11 +2121,15 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
return -1;
}
s->frame_rate_index = get_bits(&s->gb, 4);
if (s->frame_rate_index == 0 || s->frame_rate_index > 13)
if (s->frame_rate_index == 0 || s->frame_rate_index > 13) {
av_log(avctx, AV_LOG_WARNING, "frame_rate_index %d is invalid\n", s->frame_rate_index);
return -1;
}
s->bit_rate = get_bits(&s->gb, 18) * 400;
if (get_bits1(&s->gb) == 0) /* marker */
if (get_bits1(&s->gb) == 0) { /* marker */
av_log(avctx, AV_LOG_ERROR, "Marker in sequence header missing\n");
return -1;
}
s->width = width;
s->height = height;