[FFmpeg-cvslog] avcodec/loco: check get_ur_golomb_jpegls() for failure
Michael Niedermayer
git at videolan.org
Sun Jan 5 01:28:33 EET 2025
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Fri Jul 5 02:21:51 2024 +0200| [d3cda0b199da86c9c949fa0c71b7bfa64777647c] | committer: Michael Niedermayer
avcodec/loco: check get_ur_golomb_jpegls() for failure
Fixes: CID1604400 Overflowed constant
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit b9899866418cb3bd930846271470e3096917f5f6)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d3cda0b199da86c9c949fa0c71b7bfa64777647c
---
libavcodec/loco.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libavcodec/loco.c b/libavcodec/loco.c
index f9655c0bf5..28d0607502 100644
--- a/libavcodec/loco.c
+++ b/libavcodec/loco.c
@@ -89,10 +89,15 @@ static inline int loco_get_rice(RICEContext *r)
return 0;
}
v = get_ur_golomb_jpegls(&r->gb, loco_get_rice_param(r), INT_MAX, 0);
+ if (v == -1)
+ return INT_MIN;
loco_update_rice_param(r, (v + 1) >> 1);
if (!v) {
if (r->save >= 0) {
- r->run = get_ur_golomb_jpegls(&r->gb, 2, INT_MAX, 0);
+ int run = get_ur_golomb_jpegls(&r->gb, 2, INT_MAX, 0);
+ if (run == -1)
+ return INT_MIN;
+ r->run = run;
if (r->run > 1)
r->save += r->run + 1;
else
More information about the ffmpeg-cvslog
mailing list