ffmpeg | branch: master | Michael Niedermayer <mich...@niedermayer.cc> | Fri 
Jul  5 02:21:43 2024 +0200| [69dcd123f19acf851f85166159a3719565813fd0] | 
committer: Michael Niedermayer

avcodec/cri: Check length

Fixes: CID1604394 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=69dcd123f19acf851f85166159a3719565813fd0
---

 libavcodec/cri.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/cri.c b/libavcodec/cri.c
index 7b9a350967..6932bb6745 100644
--- a/libavcodec/cri.c
+++ b/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;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to