summaryrefslogtreecommitdiff
path: root/libavcodec/adpcmenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-06 17:56:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-06 18:03:31 +0200
commit049b20b287397b68804649673da32043d3908b77 (patch)
treec9c5f2c09273785edaebda3936ce89d9bc33c01d /libavcodec/adpcmenc.c
parent1aa60980d20bcacb94d475f40bdca3f404b2c542 (diff)
downloadffmpeg-049b20b287397b68804649673da32043d3908b77.tar.gz
avcodec/adpcmenc: fix integer overflow / undefined behavior in STORE_NODE()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/adpcmenc.c')
-rw-r--r--libavcodec/adpcmenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index da149a3962..c3e4d0fdf9 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -332,7 +332,7 @@ static void adpcm_compress_trellis(AVCodecContext *avctx,
uint8_t *h;\
dec_sample = av_clip_int16(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. \
* Note, changing ssd to a 64 bit variable would be \
* simpler, avoiding this check, but it's slower on \