diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-08-13 11:32:10 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-08-16 23:07:25 +0200 |
commit | 4f00519d9508e07aac58a00a9b514dae8ad95723 (patch) | |
tree | 389556b9ed992e87d2c6bcc0b59a181d72bb242a /libavcodec/vc1dec.c | |
parent | 86ca51acb089e74d9b86dfbb25dce2c6b3568047 (diff) | |
download | ffmpeg-4f00519d9508e07aac58a00a9b514dae8ad95723.tar.gz |
Fix VC-1 width/height handling.
avcodec_set_dimensions should be used for size changes to ensure
compatibility with future changes.
avctx->width/avctx->height may not be set to display-only dimensions.
Even more so since vc1dec.c would later set coded_width/height based
on this.
coded_width/coded_height should be used instead of width/height for
decoder setup.
This fixes playback of e.g. zz-mcr-nsqr.vc1 sample (containing
display width/height settings) in MPlayer and should fix a crash
with MPC: http://forum.doom9.org/showthread.php?t=162221.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r-- | libavcodec/vc1dec.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 228a02a255..7c5ce62b47 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -3418,8 +3418,8 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) if (vc1_init_common(v) < 0) return -1; ff_vc1dsp_init(&v->vc1dsp); - cur_width = avctx->coded_width = avctx->width; - cur_height = avctx->coded_height = avctx->height; + cur_width = avctx->coded_width; + cur_height = avctx->coded_height; if (avctx->codec_id == CODEC_ID_WMV3) { int count = 0; @@ -3494,13 +3494,11 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) // yet when ff_msmpeg4_decode_init was called the fist time // above. If sequence information changes, we need to call // it again. - if (cur_width != avctx->width || - cur_height != avctx->height) { + if (cur_width != avctx->coded_width || + cur_height != avctx->coded_height) { MPV_common_end(s); if(ff_msmpeg4_decode_init(avctx) < 0) return -1; - avctx->coded_width = avctx->width; - avctx->coded_height = avctx->height; } avctx->profile = v->profile; |