Commit b54e03c9 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpeg12dec: Set dimensions in mpeg1_decode_sequence() only in absence of errors

Fixes assertion failure
Fixes: 56dcafde14a8397161bb61a16c511179/signal_sigabrt_7ffff6ac8cc9_686_cov_1897408623_microsoft_new_way_to_shove_mpeg2_in_asf.dvr_ms

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent a047ccbb
...@@ -2179,8 +2179,6 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, ...@@ -2179,8 +2179,6 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
if (check_marker(&s->gb, "in sequence header") == 0) { if (check_marker(&s->gb, "in sequence header") == 0) {
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
s->width = width;
s->height = height;
s->avctx->rc_buffer_size = get_bits(&s->gb, 10) * 1024 * 16; s->avctx->rc_buffer_size = get_bits(&s->gb, 10) * 1024 * 16;
skip_bits(&s->gb, 1); skip_bits(&s->gb, 1);
...@@ -2212,6 +2210,9 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, ...@@ -2212,6 +2210,9 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
s->width = width;
s->height = height;
/* We set MPEG-2 parameters so that it emulates MPEG-1. */ /* We set MPEG-2 parameters so that it emulates MPEG-1. */
s->progressive_sequence = 1; s->progressive_sequence = 1;
s->progressive_frame = 1; s->progressive_frame = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment