[FFmpeg-cvslog] avcodec/loco: Check loco_get_rice() for failure

Michael Niedermayer git at videolan.org
Wed Jul 24 17:49:59 EEST 2024


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Fri Jul  5 02:21:52 2024 +0200| [c8b26518fc5e36db527fa5a3366b8c90621dc61a] | committer: Michael Niedermayer

avcodec/loco: Check loco_get_rice() for failure

Fixes: CID1604495 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit d55327684349b4db5d5905eefaa7d2aec597908d)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/loco.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/loco.c b/libavcodec/loco.c
index 6c389ba81c..a2960430e4 100644
--- a/libavcodec/loco.c
+++ b/libavcodec/loco.c
@@ -156,6 +156,8 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh
 
     /* restore top left pixel */
     val     = loco_get_rice(&rc);
+    if (val == INT_MIN)
+        return AVERROR_INVALIDDATA;
     data[0] = 128 + val;
     /* restore top line */
     for (i = 1; i < width; i++) {



More information about the ffmpeg-cvslog mailing list