From 454bee5be0c3721a5ca0b3b08cb6ed076f6c9e13 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Thu, 12 Nov 2020 07:15:29 +0100 Subject: [PATCH] avcodec/adpcmenc: Fix leak of trellis buffer with ADPCM_IMA_AMV Fixes Coverity ID 1469181. Reviewed-by: Zane van Iperen Signed-off-by: Andreas Rheinhardt --- libavcodec/adpcmenc.c | 1 + 1 file changed, 1 insertion(+) 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;