]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpeg12dec.c
Merge commit '3a6ddfb8745e4b306a5637927fb057f630345e2f'
[ffmpeg] / libavcodec / mpeg12dec.c
index 40962ac01dabfc4d1a7b9251fab16c8d3040f874..baa8e81ad20ee51d48bf7afe2437fa13900180e7 100644 (file)
@@ -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;