From 049b20b287397b68804649673da32043d3908b77 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 6 Jun 2014 17:56:26 +0200 Subject: [PATCH] avcodec/adpcmenc: fix integer overflow / undefined behavior in STORE_NODE() Signed-off-by: Michael Niedermayer --- libavcodec/adpcmenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 \