Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: rkvdec: Improve handling missing short/long term RPS

The values of ext_sps_st_rps and ext_sps_lt_rps in struct rkvdec_hevc_run
are not initialized when the respective controls are not set by userspace.

When this is the case, set them to NULL so the rkvdec_hevc_run_preamble
function that parses controls does not access garbage data which leads to
a panic on unaccessible memory.

Fixes: c9a59dc2acc7 ("media: rkvdec: Add HEVC support for the VDPU381 variant")
Reported-by: Christian Hewitt <christianshewitt@gmail.com>
Suggested-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
Tested-by: Christian Hewitt <christianshewitt@gmail.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Detlev Casanova and committed by
Mauro Carvalho Chehab
daa87ca4 bef4f4a8

+4
+4
drivers/media/platform/rockchip/rkvdec/rkvdec-hevc-common.c
··· 500 500 ctrl = v4l2_ctrl_find(&ctx->ctrl_hdl, 501 501 V4L2_CID_STATELESS_HEVC_EXT_SPS_ST_RPS); 502 502 run->ext_sps_st_rps = ctrl ? ctrl->p_cur.p : NULL; 503 + } else { 504 + run->ext_sps_st_rps = NULL; 503 505 } 504 506 if (ctx->has_sps_lt_rps) { 505 507 ctrl = v4l2_ctrl_find(&ctx->ctrl_hdl, 506 508 V4L2_CID_STATELESS_HEVC_EXT_SPS_LT_RPS); 507 509 run->ext_sps_lt_rps = ctrl ? ctrl->p_cur.p : NULL; 510 + } else { 511 + run->ext_sps_lt_rps = NULL; 508 512 } 509 513 510 514 rkvdec_run_preamble(ctx, &run->base);