aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-03-09 00:55:38 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-10 16:04:26 +0200
commitbd4060a718599dc8359a33c60bb29f58792c7754 (patch)
tree56394feffb7ef0f662ee35164033a3865b4dbb70
parent467a2c95a9218587c6bd26593b48b88d00c5fd12 (diff)
downloadffmpeg-bd4060a718599dc8359a33c60bb29f58792c7754.tar.gz
avcodec/flacdec: Avoid undefined shift in error case
Fixes: flac_1040988 Reported-by: Thomas Guilbert <tguilbert@google.com> Reviewed-by: Thomas Guilbert <tguilbert@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit bd525e2876bef428e896b8da5e5b5507451f4ed5) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/flacdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index c8eb456049..8de8ebd80e 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;