Browse Source

avcodec/apedec: Fix integer overflow in predictor_update_3930()

Fixes: signed integer overflow: -69555262 * 31 cannot be represented in type 'int'
Fixes: 17698/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5728970447781888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5c072c9ed7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.2.15
Michael Niedermayer 6 years ago
parent
commit
462949e087
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/apedec.c

+ 1
- 1
libavcodec/apedec.c View File

@@ -1051,7 +1051,7 @@ static av_always_inline int predictor_update_3930(APEPredictor *p,
d3 * p->coeffsA[filter][3];

p->lastA[filter] = decoded + (predictionA >> 9);
p->filterA[filter] = p->lastA[filter] + ((p->filterA[filter] * 31) >> 5);
p->filterA[filter] = p->lastA[filter] + ((int)(p->filterA[filter] * 31U) >> 5);

sign = APESIGN(decoded);
p->coeffsA[filter][0] += ((d0 < 0) * 2 - 1) * sign;


Loading…
Cancel
Save