diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2024-07-05 02:21:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2024-07-12 22:42:38 +0200 |
commit | d55327684349b4db5d5905eefaa7d2aec597908d (patch) | |
tree | 646e6e263c97f0e8964f638bf54d9c1698494efa | |
parent | b9899866418cb3bd930846271470e3096917f5f6 (diff) | |
download | ffmpeg-d55327684349b4db5d5905eefaa7d2aec597908d.tar.gz |
avcodec/loco: Check loco_get_rice() for failure
Fixes: CID1604495 Overflowed constant
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/loco.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/loco.c b/libavcodec/loco.c index 4aba1eb9c5..d73d8fa88b 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -157,6 +157,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++) { |