[FFmpeg-devel] [PATCH 4/5] avcodec/ffv1enc: Fix signed type handling with remap

Michael Niedermayer michael at niedermayer.cc
Sat Mar 15 02:00:06 EET 2025


Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/ffv1enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 3879d1b19a1..b3fb6560e5a 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -310,7 +310,7 @@ static int encode_plane(FFV1Context *f, FFV1SliceContext *sc,
             }
             if (sc->remap)
                 for (x = 0; x < w; x++)
-                    sample[0][x] = sc->fltmap[remap_index][ sample[0][x] ];
+                    sample[0][x] = sc->fltmap[remap_index][ (uint16_t)sample[0][x] ];
 
             if((ret = encode_line(f, sc, f->avctx, w, sample, plane_index, f->bits_per_raw_sample, ac, pass1)) < 0)
                 return ret;
-- 
2.48.1



More information about the ffmpeg-devel mailing list