aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-11-02 15:52:52 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-31 19:51:56 +0100
commit96ccd5665c5582e53feb7ee9d8dda6825bf05df6 (patch)
tree155eb0491f35dd09f046da6a99ec161535198102
parent9eecca08e761ffd9c2b33c56ecdea325f1a7de1b (diff)
downloadffmpeg-96ccd5665c5582e53feb7ee9d8dda6825bf05df6.tar.gz
avcodec/ralf: use multiply instead of shift to avoid undefined behavior in decode_block()
Fixes: left shift of negative value -249 Fixes: 18566/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5649394561187840 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 1b7d02642b2096622cee6165fea1301bb9ad54ff) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ralf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ralf.c b/libavcodec/ralf.c
index 1d881cf7ae..ca8817aa21 100644
--- a/libavcodec/ralf.c
+++ b/libavcodec/ralf.c
@@ -408,7 +408,7 @@ static int decode_block(AVCodecContext *avctx, GetBitContext *gb,
case 4:
for (i = 0; i < len; i++) {
t = ch1[i] + ctx->bias[1];
- t2 = ((ch0[i] + ctx->bias[0]) << 1) | (t & 1);
+ t2 = ((ch0[i] + ctx->bias[0]) * 2) | (t & 1);
dst0[i] = (t2 + t) / 2;
dst1[i] = (t2 - t) / 2;
}