PR #25076 opened by romainhedouin
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25076
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25076.patch

With one patch, the scale was stored in icoeff[c][1+c] instead of 
icoeff[1+c][c], the layout used by the default and two-patch cases, so the 
mapping had no effect on the matching channel

Tested: make fate passes. Mapping a gray 0x808080 patch to 0x4080FF gave 
0x808080 before and 0x4080FF now

Signed-off-by: romainhedouin <[email protected]>

<!--
If this PR requires new FATE test samples, attach them to the PR and
list their target paths below (relative to the fate-suite root).

Attached filenames must match the sample's filename:

```fate-samples
# e.g. vorbis/new-sample.ogg
```
-->



>From 09b860b561027880afb201805fd69857c0cb4872 Mon Sep 17 00:00:00 2001
From: romainhedouin <[email protected]>
Date: Wed, 14 Oct 2026 21:07:20 +0200
Subject: [PATCH] avfilter/vf_colormap: fix coefficient index for a single
 patch

With one patch, the scale was stored in icoeff[c][1+c] instead of
icoeff[1+c][c], the layout used by the default and two-patch cases,
so the mapping had no effect on the matching channel.

Tested: make fate passes. Mapping a gray 0x808080 patch to 0x4080FF
gave 0x808080 before and 0x4080FF now.

Found with the help of an AI code review; verified by hand.

Signed-off-by: romainhedouin <[email protected]>
---
 libavfilter/vf_colormap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_colormap.c b/libavfilter/vf_colormap.c
index 4680a7b501..dbb3a2b9e4 100644
--- a/libavfilter/vf_colormap.c
+++ b/libavfilter/vf_colormap.c
@@ -192,7 +192,7 @@ static void build_map(AVFilterContext *ctx)
         case 1:
             {
                 float div = fabsf(s->source[0][c]) < 1e-6f ? 1e-6f : 
s->source[0][c];
-                s->icoeff[c][1+c] = s->target[0][c] / div;
+                s->icoeff[1+c][c] = s->target[0][c] / div;
             }
             break;
         case 2:
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to