Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-18 18:09:31 +0300
committerMichael Niedermayer <michaelni@gmx.at>2014-12-18 18:10:23 +0300
commite59c28b16660b8f86ef05c7f0db4db89e62ed55f (patch)
tree51f6959432ad1347866aff716ac39a1313c19ee8 /libavcodec/adpcm.c
parent61296d41e2de3b41304339e4631dd44c2e15f805 (diff)
avcodec/adpcm: Check idelta
Fixes integer overflow Fixes: signal_sigsegv_1b0a4da_1865_cov_2167818389_computer_anger.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r--libavcodec/adpcm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 2f95a6ff45..7785a7a6dc 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -246,6 +246,10 @@ static inline short adpcm_ms_expand_nibble(ADPCMChannelStatus *c, int nibble)
c->sample1 = av_clip_int16(predictor);
c->idelta = (ff_adpcm_AdaptationTable[(int)nibble] * c->idelta) >> 8;
if (c->idelta < 16) c->idelta = 16;
+ if (c->idelta > INT_MAX/768) {
+ av_log(NULL, AV_LOG_WARNING, "idelta overflow\n");
+ c->idelta = INT_MAX/768;
+ }
return c->sample1;
}