[PATCH v3 3/5] media: verisilicon: Size reference frames by the stream bit depth
Arun Iyengar via B4 Relay
devnull+aiyengar1990.gmail.com at kernel.org
Mon Nov 30 13:53:04 PST 2026
From: Arun Iyengar <aiyengar1990 at gmail.com>
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 at vger.kernel.org
Signed-off-by: Arun Iyengar <aiyengar1990 at gmail.com>
---
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
More information about the Linux-rockchip
mailing list