[FFmpeg-cvslog] avcodec/flacdec: Avoid undefined shift in error case

Michael Niedermayer git at videolan.org
Sat Mar 13 22:52:49 EET 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Mar  9 00:55:38 2021 +0100| [bd525e2876bef428e896b8da5e5b5507451f4ed5] | committer: Michael Niedermayer

avcodec/flacdec: Avoid undefined shift in error case

Fixes: flac_1040988

Reported-by: Thomas Guilbert <tguilbert at google.com>
Reviewed-by: Thomas Guilbert <tguilbert at google.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index cf6128f897..9e55bc1361 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -262,7 +262,7 @@ static int decode_residuals(FLACContext *s, int32_t *decoded, int pred_order)
         } else {
             int real_limit = tmp ? (INT_MAX >> tmp) + 2 : INT_MAX;
             for (; i < samples; i++) {
-                int v = get_sr_golomb_flac(&gb, tmp, real_limit, 0);
+                int v = get_sr_golomb_flac(&gb, tmp, real_limit, 1);
                 if (v == 0x80000000){
                     av_log(s->avctx, AV_LOG_ERROR, "invalid residual\n");
                     return AVERROR_INVALIDDATA;



More information about the ffmpeg-cvslog mailing list