Commit 049b20b2 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/adpcmenc: fix integer overflow / undefined behavior in STORE_NODE()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1aa60980
...@@ -332,7 +332,7 @@ static void adpcm_compress_trellis(AVCodecContext *avctx, ...@@ -332,7 +332,7 @@ static void adpcm_compress_trellis(AVCodecContext *avctx,
uint8_t *h;\ uint8_t *h;\
dec_sample = av_clip_int16(dec_sample);\ dec_sample = av_clip_int16(dec_sample);\
d = sample - dec_sample;\ d = sample - dec_sample;\
ssd = nodes[j]->ssd + d*d;\ ssd = nodes[j]->ssd + d*(unsigned)d;\
/* Check for wraparound, skip such samples completely. \ /* Check for wraparound, skip such samples completely. \
* Note, changing ssd to a 64 bit variable would be \ * Note, changing ssd to a 64 bit variable would be \
* simpler, avoiding this check, but it's slower on \ * simpler, avoiding this check, but it's slower on \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment