media: imagination: Fix value clamping in calculate_qp_tables
Subsystems (3)
PATCH 1/1 media: imagination: Fix value clamping in calculate_qp_tables
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'.
--- drivers/media/platform/imagination/e5010-jpeg-enc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/imagination/e5010-jpeg-enc.c +2 -2
@@ -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; }
Signature · 2 lines
Thorsten Blum <[email protected]> GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
Quoted 9 lines · Thorsten Blum
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'.Fixes a1e294045885 ("media: imagination: Add E5010 JPEG Encoder driver")Signed-off-by Thorsten Blum <[email protected]>---
[...]
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 [email protected] 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