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

avcodec/cri: Check length

Fixes: CID1604394 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 69dcd123f19acf851f85166159a3719565813fd0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-07-05 02:21:43 +02:00
parent 0c24fec67f
commit a116ca9b24
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -236,10 +236,14 @@ static int cri_decode_frame(AVCodecContext *avctx, void *data,
s->data_size = length;
goto skip;
case 105:
if (length <= 0)
return AVERROR_INVALIDDATA;
hflip = bytestream2_get_byte(gb) != 0;
length--;
goto skip;
case 106:
if (length <= 0)
return AVERROR_INVALIDDATA;
vflip = bytestream2_get_byte(gb) != 0;
length--;
goto skip;