]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: verisilicon: Protect G2 HEVC decoder against invalid DPB index
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Mon, 5 Jan 2026 20:54:26 +0000 (15:54 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:10:09 +0000 (13:10 +0100)
commit2e6f384b4e6c913c81f6a9fc6caf74ad574e065a
treebec16e8f2088b2524ca699087d6871cac8026bf8
parentb425cd5bc54e3e3075a0d813cc634b03654399c3
media: verisilicon: Protect G2 HEVC decoder against invalid DPB index

[ Upstream commit 47825b1646a6a9eca0f90baa3d4f98947c2add96 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/hantro/hantro_g2_hevc_dec.c