[FFmpeg-devel] [PATCH 06/11] avcodec/ffv1dec: replace literal 65535 by what it is

Michael Niedermayer michael at niedermayer.cc
Mon Mar 24 19:39:40 EET 2025


should make the code easier to understand

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

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 21a7642a08b..25b55864107 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -326,7 +326,7 @@ static int decode_remap(FFV1Context *f, FFV1SliceContext *sc)
                 }
                 if (i == end)
                     break;
-                if (i - 1 > end || j > 65535)
+                if (i - 1 > end || j >= FF_ARRAY_ELEMS(sc->fltmap[p]))
                     return AVERROR_INVALIDDATA;
                 if (end <= 0xFFFF) {
                     sc->fltmap  [p][j++] = i ^ ((i&    0x8000) ? 0 : flip);
-- 
2.48.1



More information about the ffmpeg-devel mailing list