[FFmpeg-cvslog] avcodec/mpeg12dec: do not trust AVCodecContext input dimensions

Michael Niedermayer git at videolan.org
Wed Nov 5 09:58:34 CET 2014


ffmpeg | branch: release/2.4 | Michael Niedermayer <michaelni at gmx.at> | Wed Nov  5 01:21:59 2014 +0100| [cd57d608a4125a996671e7d013767120cb60513d] | committer: Carl Eugen Hoyos

avcodec/mpeg12dec: do not trust AVCodecContext input dimensions

Fixes initial wtv dimensions
Fixes Ticket4070
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 77f1199e8fd9a289ad64eb2bb5bd4deeda8bccb8)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cd57d608a4125a996671e7d013767120cb60513d
---

 libavcodec/mpeg12dec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 95cc1a8..d5e1fb6 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;



More information about the ffmpeg-cvslog mailing list