summaryrefslogtreecommitdiff
path: root/libavcodec/adpcmenc.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-12 07:15:29 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-12 07:23:06 +0100
commit454bee5be0c3721a5ca0b3b08cb6ed076f6c9e13 (patch)
tree3625dd2c4b01ed255c35bd3e2472fcc56cdc57b9 /libavcodec/adpcmenc.c
parentac5b45abab3815c36c9110f979b547b2189e739d (diff)
downloadffmpeg-454bee5be0c3721a5ca0b3b08cb6ed076f6c9e13.tar.gz
avcodec/adpcmenc: Fix leak of trellis buffer with ADPCM_IMA_AMV
Fixes Coverity ID 1469181. Reviewed-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/adpcmenc.c')
-rw-r--r--libavcodec/adpcmenc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index 20568cfc89..4bab004dac 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -876,6 +876,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
bytestream_put_byte(&dst, (buf[2 * i] << 4) | buf[2 * i + 1]);
samples += 2 * n;
+ av_free(buf);
} else for (n = frame->nb_samples >> 1; n > 0; n--) {
int nibble;
nibble = adpcm_ima_compress_sample(&c->status[0], *samples++) << 4;