Commit 6076399974 for ffmpeg
commit 607639997482f64381dc800d5dabad8a8979cde9
Author: Martin Mirchev <mmirchev@comp.nus.edu.sg>
Date: Sun Oct 18 16:13:01 2026 +0800
avfilter/vf_colormap: fix single-patch coefficient index
With one patch, the per-channel gains were written to transposed
coefficient indices. Subsequent channel initialization cleared the first
two misplaced gains, while the third was stored in an unused column,
leaving the identity transform in place: mapping 0xA06040 to 0x503020
turned 0xA06040 into (160,97,63) instead of (80,48,32).
Store each gain at icoeff[1+c][c], matching the pixel loop and the
two-patch case.
Signed-off-by: Martin Mirchev <mmirchev@comp.nus.edu.sg>
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: