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 69dcd123f1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/7.0
Michael Niedermayer 7 months ago
parent 72b087cf0d
commit d6efa604a2
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 4
      libavcodec/cri.c

@ -234,10 +234,14 @@ static int cri_decode_frame(AVCodecContext *avctx, AVFrame *p,
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;

Loading…
Cancel
Save