amstream: fix null pointer crash in dv frame mode. [1/1]
authorshihong.zheng <shihong.zheng@amlogic.com>
Mon, 27 Jul 2020 06:45:45 +0000 (14:45 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Tue, 28 Jul 2020 02:10:53 +0000 (19:10 -0700)
PD#SWPL-30431

Problem:
secure dolby vision frame mode crash.

Solution:
no slave vdec in dolby vision frame mode.
so needn't set slave vdec port_flag.

Verify:
ah212

Change-Id: Ib4010e8d243be0fba773b02b0f6984ea9f9dfb67
Signed-off-by: shihong.zheng <shihong.zheng@amlogic.com>
drivers/stream_input/amports/amstream.c

index bfb44b412d967530fa8eff9a8df884bd78a77427..b204dc6968aabdeb8ee773aefec9f19fb71d2f5c 100644 (file)
@@ -622,7 +622,7 @@ static int video_port_init(struct port_priv_s *priv,
                pr_err("vformat not set\n");
                return -EPERM;
        }
-       if (vdec_dual(vdec) && vdec_secure(vdec)) {
+       if (vdec_dual(vdec) && vdec_secure(vdec) && (vdec->slave)) {
                /*copy drm flags for slave dec.*/
                vdec->slave->port_flag |= PORT_FLAG_DRM;
        }