aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg12dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-05 01:21:59 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-05 02:00:22 +0100
commit77f1199e8fd9a289ad64eb2bb5bd4deeda8bccb8 (patch)
tree6101401dcab8dd0ff5f68abb94eeda81b7002d69 /libavcodec/mpeg12dec.c
parentf2ffaae9ac93e221a0e1e11ea3581422323abd2f (diff)
downloadffmpeg-77f1199e8fd9a289ad64eb2bb5bd4deeda8bccb8.tar.gz
avcodec/mpeg12dec: do not trust AVCodecContext input dimensions
Fixes initial wtv dimensions Fixes Ticket4070 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpeg12dec.c')
-rw-r--r--libavcodec/mpeg12dec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 40962ac01d..baa8e81ad2 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1120,6 +1120,10 @@ static av_cold int mpeg_decode_init(AVCodecContext *avctx)
MpegEncContext *s2 = &s->mpeg_enc_ctx;
ff_mpv_decode_defaults(s2);
+
+ if ( avctx->codec_tag != AV_RL32("VCR2")
+ && avctx->codec_tag != AV_RL32("BW10"))
+ avctx->coded_width = avctx->coded_height = 0; // do not trust dimensions from input
ff_mpv_decode_init(s2, avctx);
s->mpeg_enc_ctx.avctx = avctx;