[FFmpeg-cvslog] lavc/flacdec: Increase residual limit from INT_MAX to UINT_MAX

Martijn van Beurden git at videolan.org
Sat Apr 30 22:34:27 EEST 2022


ffmpeg | branch: master | Martijn van Beurden <mvanb1 at gmail.com> | Tue Apr  5 15:37:47 2022 +0200| [296d3bbe167f06168ac54724626006b43002833f] | committer: Michael Niedermayer

lavc/flacdec: Increase residual limit from INT_MAX to UINT_MAX

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/flacdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index a23d7e2cf1..87f20c7425 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -260,7 +260,7 @@ static int decode_residuals(FLACContext *s, int32_t *decoded, int pred_order)
             for (; i < samples; i++)
                 *decoded++ = get_sbits_long(&gb, tmp);
         } else {
-            int real_limit = tmp ? (INT_MAX >> tmp) + 2 : INT_MAX;
+            int real_limit = (tmp > 1) ? (INT_MAX >> (tmp - 1)) + 2 : INT_MAX;
             for (; i < samples; i++) {
                 int v = get_sr_golomb_flac(&gb, tmp, real_limit, 1);
                 if (v == 0x80000000){



More information about the ffmpeg-cvslog mailing list