v4ldec: CB1 Fix NTX crash issue caused by a null pointer.. [1/1]
PD#SWPL-198070
Problem:
During the resolution switching process, `aml_buf_configure_update`
is invoked without assigning a value to `dynamic_mode`, which may
result in random values causing exceptions.
Solution:
`aml_buf_configure_update` needs to update the `dynamic_mode`
information promptly.
Verify:
BM201
Signed-off-by: kun.liu <kun.liu@amlogic.com>
Change-Id: I35861d52f83490d3e1cc16d8114861c30add03f2
diff --git a/drivers/amvdec_ports/aml_vcodec_dec.c b/drivers/amvdec_ports/aml_vcodec_dec.c
index bd45e39..99318e9 100644
--- a/drivers/amvdec_ports/aml_vcodec_dec.c
+++ b/drivers/amvdec_ports/aml_vcodec_dec.c
@@ -774,7 +774,7 @@
void aml_vdec_pic_info_update(struct aml_vcodec_ctx *ctx)
{
- struct aml_buf_config config;
+ struct aml_buf_config config = { 0 };
struct vb2_queue * que = v4l2_m2m_get_dst_vq(ctx->m2m_ctx);
u32 dw = DM_YUV_ONLY;
u32 tw = DM_INVALID;
@@ -836,6 +836,8 @@
config.dw_mode = dw;
config.tw_mode = tw;
config.avbcd_work_mode = ctx->avbcd_work_mode ? true : false;
+ config.dynamic_mode = (ctx->enable_di_post && ctx->picinfo.field != V4L2_FIELD_NONE &&
+ is_vdec_core_fmt(ctx->output_pix_fmt)) ? true : false;
aml_buf_configure(&ctx->bm, &config);