Re: [PATCH] media: vicodec: fix out-of-bounds write in FWHT encoder
From: Hans Verkuil
Date: Sat Jul 11 2026 - 04:55:08 EST
On 11/07/2026 08:29, Junrui Luo wrote:
> Hi Hans,
>
> Thanks for the review.
>
> On Fri, Jul 10, 2026 at 10:32:09AM +0200, Hans Verkuil wrote:
>> Actually, it's commit b40dc2bf3581 ("media: vicodec: add support for 4 new
>> RGB32 pixelformats") that introduced this.
>>
>> Please update the Fixes tag.
>
> I traced this back a bit further. Commit 16ecf6dff97c ("media:
> vicodec: Add support for 4 planes formats") already added ARGB32 and
> ABGR32 as four-component formats. Would this be more appropriate?
Yes, you are right. That's when support for this was added.
Good catch.
>
>>
>>> Reported-by: Yuhao Jiang <danisjiang@xxxxxxxxx>
>>
>> Where was that reported? Is there a URL to the that report?
>
> It was reported to me privately by Yuhao, so there is no public URL.
>
>>
>>> Cc: stable@xxxxxxxxxxxxxxx
>>> Signed-off-by: Junrui Luo <moonafterrain@xxxxxxxxxxx>
>>> ---
>>> drivers/media/test-drivers/vicodec/vicodec-core.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/media/test-drivers/vicodec/vicodec-core.c b/drivers/media/test-drivers/vicodec/vicodec-core.c
>>> index 318e8330f16a..3ff2d06742c2 100644
>>> --- a/drivers/media/test-drivers/vicodec/vicodec-core.c
>>> +++ b/drivers/media/test-drivers/vicodec/vicodec-core.c
>>> @@ -63,7 +63,7 @@ struct pixfmt_info {
>>> };
>>>
>>> static const struct v4l2_fwht_pixfmt_info pixfmt_fwht = {
>>> - V4L2_PIX_FMT_FWHT, 0, 3, 1, 1, 1, 1, 1, 0, 1
>>> + V4L2_PIX_FMT_FWHT, 0, 4, 1, 1, 1, 1, 1, 0, 1
>>> };
>>>
>>> static const struct v4l2_fwht_pixfmt_info pixfmt_stateless_fwht = {
>>
>> It should be changed here as well, otherwise the test-media regression script
>> in v4l-utils will fail.
>
> I will update in v2.
Regards,
Hans