aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-01 00:10:47 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-11 20:18:48 +0100
commit5d4036d0b287caf76edf3a1e2196a9a87b070256 (patch)
tree5ed20f73c042abcb2b60091680e63b28112a368b
parent188204da6cb503ec7de1ca80e7162bf8abf616aa (diff)
downloadffmpeg-5d4036d0b287caf76edf3a1e2196a9a87b070256.tar.gz
avcodec/smacker: Fix integer overflows in pred[] in smka_decode_frame()
Fixes: signed integer overflow: -2147481503 + -32732 cannot be represented in type 'int' Fixes: 17782/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKAUD_fuzzer-5769672225456128 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 a76897e19ca96127e07f5acc5a773b904dcf6124) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/smacker.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 27da0bc97a..3e3eed9f7e 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -735,7 +735,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
val |= h[3].values[res] << 8;
- pred[1] += sign_extend(val, 16);
+ pred[1] += (unsigned)sign_extend(val, 16);
*samples++ = pred[1];
} else {
if(vlc[0].table)
@@ -756,7 +756,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
val |= h[1].values[res] << 8;
- pred[0] += sign_extend(val, 16);
+ pred[0] += (unsigned)sign_extend(val, 16);
*samples++ = pred[0];
}
}