1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/ffv1dec: Fix end handling

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2025-03-25 12:30:16 +01:00
parent ffd537bcc2
commit 430065a97b

View File

@ -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);