aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2025-03-25 12:30:16 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2025-03-27 22:02:36 +0100
commit430065a97b08f7065629b743b26622980cd6e212 (patch)
treec16b8c9fd64f55396f5f38c99e5bb02f6a27ed72
parentffd537bcc2da727495f860382a5c899e4fbe6dff (diff)
downloadffmpeg-430065a97b08f7065629b743b26622980cd6e212.tar.gz
avcodec/ffv1dec: Fix end handling
Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ffv1dec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 25b5586410..3395f514f4 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -324,9 +324,9 @@ static int decode_remap(FFV1Context *f, FFV1SliceContext *sc)
return AVERROR_INVALIDDATA; //not sure we should check this
i += current_mul - 1 + delta;
}
- if (i == end)
+ if (i - 1 >= end)
break;
- if (i - 1 > end || j >= FF_ARRAY_ELEMS(sc->fltmap[p]))
+ if (j >= FF_ARRAY_ELEMS(sc->fltmap[p]))
return AVERROR_INVALIDDATA;
if (end <= 0xFFFF) {
sc->fltmap [p][j++] = i ^ ((i& 0x8000) ? 0 : flip);