* [PATCH] media: imagination: Fix value clamping in calculate_qp_tables
@ 2025-12-02 12:45 Thorsten Blum
2025-12-19 21:30 ` Thorsten Blum
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2025-12-02 12:45 UTC (permalink / raw)
To: Devarsh Thakkar, Mauro Carvalho Chehab, Hans Verkuil, David Huang,
Sebastian Fricke, Benjamin Gaignard
Cc: Thorsten Blum, stable, linux-media, linux-kernel
The local variable 'val' was never clamped to 1 or 255 because the
return value of clamp() was not used. Fix this by assigning the clamped
value back to 'val'.
Cc: stable@vger.kernel.org
Fixes: a1e294045885 ("media: imagination: Add E5010 JPEG Encoder driver")
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
drivers/media/platform/imagination/e5010-jpeg-enc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/imagination/e5010-jpeg-enc.c b/drivers/media/platform/imagination/e5010-jpeg-enc.c
index c4e0097cb8b7..a36a2acc896c 100644
--- a/drivers/media/platform/imagination/e5010-jpeg-enc.c
+++ b/drivers/media/platform/imagination/e5010-jpeg-enc.c
@@ -175,12 +175,12 @@ static void calculate_qp_tables(struct e5010_context *ctx)
long long delta = v4l2_jpeg_ref_table_chroma_qt[i] * contrast + luminosity;
int val = (int)(v4l2_jpeg_ref_table_chroma_qt[i] + delta);
- clamp(val, 1, 255);
+ val = clamp(val, 1, 255);
ctx->chroma_qp[i] = quality == -50 ? 1 : val;
delta = v4l2_jpeg_ref_table_luma_qt[i] * contrast + luminosity;
val = (int)(v4l2_jpeg_ref_table_luma_qt[i] + delta);
- clamp(val, 1, 255);
+ val = clamp(val, 1, 255);
ctx->luma_qp[i] = quality == -50 ? 1 : val;
}
--
Thorsten Blum <thorsten.blum@linux.dev>
GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media: imagination: Fix value clamping in calculate_qp_tables
2025-12-02 12:45 [PATCH] media: imagination: Fix value clamping in calculate_qp_tables Thorsten Blum
@ 2025-12-19 21:30 ` Thorsten Blum
0 siblings, 0 replies; 2+ messages in thread
From: Thorsten Blum @ 2025-12-19 21:30 UTC (permalink / raw)
To: Devarsh Thakkar, Mauro Carvalho Chehab, Hans Verkuil, David Huang,
Sebastian Fricke, Benjamin Gaignard
Cc: stable, linux-media, linux-kernel
On 2. Dec 2025, at 13:45, Thorsten Blum wrote:
> The local variable 'val' was never clamped to 1 or 255 because the
> return value of clamp() was not used. Fix this by assigning the clamped
> value back to 'val'.
>
> Cc: stable@vger.kernel.org
> Fixes: a1e294045885 ("media: imagination: Add E5010 JPEG Encoder driver")
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> [...]
Hello, the media CI robot complained to me privately (not to the list)
with the following error:
ERROR: Commit a1e2940458853d00c178c842c889e4ae3ef5eaec NOT found in
the stable tree, but stable@vger.kernel.org is in Cc:
However, the Fixes: tag references the commit hash in master, but the
commit has a different hash in the stable branches. This is my first
time running into such an issue and I'm not sure what to do about it?
Thanks,
Thorsten
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-19 21:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-02 12:45 [PATCH] media: imagination: Fix value clamping in calculate_qp_tables Thorsten Blum
2025-12-19 21:30 ` Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox