diff mbox series

[FFmpeg-devel] avcodec/adpcmenc: Fix leak of trellis buffer with ADPCM_IMA_AMV

Message ID 20201112061851.566824-1-andreas.rheinhardt@gmail.com
State Accepted
Commit 454bee5be0c3721a5ca0b3b08cb6ed076f6c9e13
Headers show
Series [FFmpeg-devel] avcodec/adpcmenc: Fix leak of trellis buffer with ADPCM_IMA_AMV | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Nov. 12, 2020, 6:18 a.m. UTC
Fixes Coverity ID 1469181.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
Intend to apply this triviality soon.

 libavcodec/adpcmenc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Zane van Iperen Nov. 12, 2020, 6:22 a.m. UTC | #1
On 12/11/20 4:18 pm, Andreas Rheinhardt wrote:
> Fixes Coverity ID 1469181.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
> Intend to apply this triviality soon.
> 
>   libavcodec/adpcmenc.c | 1 +
>   1 file changed, 1 insertion(+)
> 

This looks fine
diff mbox series

Patch

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;