From: John Koleszar Date: Wed, 23 May 2012 19:07:53 +0000 (-0700) Subject: Prevent external frame size changes in two-pass X-Git-Tag: v1.2.0~191^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=410ae576e733674a66b6f7963a60a25b4310d3b4;p=libvpx Prevent external frame size changes in two-pass The two-pass code does not support the case where the application changes the frame size dynamically. Add this case to the validation checks in the vpx_codec_enc_config_set() path. Change-Id: Idadc42c7c3bd566ecdbce30d8dd720add097f992 --- diff --git a/vp8/vp8_cx_iface.c b/vp8/vp8_cx_iface.c index 9a6bc301a..ca06648fb 100644 --- a/vp8/vp8_cx_iface.c +++ b/vp8/vp8_cx_iface.c @@ -447,7 +447,7 @@ static vpx_codec_err_t vp8e_set_config(vpx_codec_alg_priv_t *ctx, vpx_codec_err_t res; if (((cfg->g_w != ctx->cfg.g_w) || (cfg->g_h != ctx->cfg.g_h)) - && cfg->g_lag_in_frames > 1) + && (cfg->g_lag_in_frames > 1 || cfg->g_pass != VPX_RC_ONE_PASS)) ERROR("Cannot change width or height after initialization"); /* Prevent increasing lag_in_frames. This check is stricter than it needs