diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-01 02:45:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-01 02:47:11 +0200 |
commit | b54e03c9dc2a05324c08b503bfe7535c49c0f281 (patch) | |
tree | 7f7f8f13a8f03e9a3f608db7d653be8232b3bccd /libavcodec/mpeg12dec.c | |
parent | a047ccbb9fad2c33db7ebc40b95e34ea6ee89c21 (diff) | |
download | ffmpeg-b54e03c9dc2a05324c08b503bfe7535c49c0f281.tar.gz |
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: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mpeg12dec.c')
-rw-r--r-- | libavcodec/mpeg12dec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 5f42e95f70..53ad186875 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -2179,8 +2179,6 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, if (check_marker(&s->gb, "in sequence header") == 0) { return AVERROR_INVALIDDATA; } - s->width = width; - s->height = height; s->avctx->rc_buffer_size = get_bits(&s->gb, 10) * 1024 * 16; skip_bits(&s->gb, 1); @@ -2212,6 +2210,9 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, return AVERROR_INVALIDDATA; } + s->width = width; + s->height = height; + /* We set MPEG-2 parameters so that it emulates MPEG-1. */ s->progressive_sequence = 1; s->progressive_frame = 1; |