[PATCH v3 3/5] media: verisilicon: Size reference frames by the stream bit depth

From: Arun Iyengar via B4 Relay

Date: Mon Nov 30 2026 - 16:53:46 EST


From: Arun Iyengar <aiyengar1990@xxxxxxxxx>

The reference format takes its depth from the CAPTURE format. With an
8-bit post-processed CAPTURE format (NV12) on a 10-bit stream, the
reference buffers are sized for 8 bits and the decoder overruns them.
Use ctx->bit_depth instead.

Fixes: db300ab0e9d3 ("media: verisilicon: Store reference frames pixels format")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
drivers/media/platform/verisilicon/hantro_v4l2.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/verisilicon/hantro_v4l2.c b/drivers/media/platform/verisilicon/hantro_v4l2.c
index bf5f608bdbe8..315954e090f9 100644
--- a/drivers/media/platform/verisilicon/hantro_v4l2.c
+++ b/drivers/media/platform/verisilicon/hantro_v4l2.c
@@ -131,9 +131,8 @@ static int
hantro_set_reference_frames_format(struct hantro_ctx *ctx)
{
const struct hantro_fmt *fmt;
- int dst_bit_depth = hantro_get_format_depth(ctx->vpu_dst_fmt->fourcc);

- fmt = hantro_get_default_fmt(ctx, false, dst_bit_depth, HANTRO_AUTO_POSTPROC);
+ fmt = hantro_get_default_fmt(ctx, false, ctx->bit_depth, HANTRO_AUTO_POSTPROC);
if (!fmt)
return -EINVAL;


--
2.55.0