diff --git a/libavcodec/cri.c b/libavcodec/cri.c index 0558d0c8dd..d2d80b6f1c 100644 --- a/libavcodec/cri.c +++ b/libavcodec/cri.c @@ -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;