]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
media: verisilicon: Protect G2 HEVC decoder against invalid DPB index
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Mon, 22 Sep 2025 18:43:39 +0000 (14:43 -0400)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Mon, 20 Oct 2025 07:23:17 +0000 (09:23 +0200)
commit47825b1646a6a9eca0f90baa3d4f98947c2add96
tree65543830f808c7083b07264fefe6d43aa36cf600
parent19c286b755072a22a063052f530a6b1fac8a1f63
media: verisilicon: Protect G2 HEVC decoder against invalid DPB index

Fix the Hantro G2 HEVC decoder so that we use DPB index 0 whenever a
ninvalid index is received from user space. This protects the hardware
from doing faulty memory access which then leads to bus errors.

To be noted that when a reference is missing, userspace such as GStreamer
passes an invalid DPB index of 255. This issue was found by seeking to a
CRA picture using GStreamer. The framework is currently missing the code
to skip over RASL pictures placed after the CRA. This situation can also
occur while doing live streaming over lossy transport.

Fixes: cb5dd5a0fa518 ("media: hantro: Introduce G2/HEVC decoder")
Cc: stable@vger.kernel.org
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/verisilicon/hantro_g2_hevc_dec.c