diff mbox

[FFmpeg-devel] mpegaudiodec_template: fix leaking fdsp for mp3on4float

Message ID 9fd58af1-6b73-2f7c-9825-bed74375e4a8@googlemail.com
State Accepted
Commit 783b350b2e49d06030b30ee9b7e1aa5825e4a5a5
Headers show

Commit Message

Andreas Cadhalpun Feb. 15, 2017, 11:39 p.m. UTC
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
---
 libavcodec/mpegaudiodec_template.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer Feb. 16, 2017, 2:12 a.m. UTC | #1
On Thu, Feb 16, 2017 at 12:39:17AM +0100, Andreas Cadhalpun wrote:
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
> ---
>  libavcodec/mpegaudiodec_template.c | 3 +++
>  1 file changed, 3 insertions(+)

should be ok

why was this not detected by fate ?
are we lacking a test for this ?

[...]
Andreas Cadhalpun Feb. 17, 2017, 12:47 a.m. UTC | #2
On 16.02.2017 03:12, Michael Niedermayer wrote:
> On Thu, Feb 16, 2017 at 12:39:17AM +0100, Andreas Cadhalpun wrote:
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
>> ---
>>  libavcodec/mpegaudiodec_template.c | 3 +++
>>  1 file changed, 3 insertions(+)
> 
> should be ok

Pushed.

> why was this not detected by fate ?
> are we lacking a test for this ?

There is no fate test and since it uses float, it seems non-trivial to
add a platform-independent one.

Best regards,
Andreas
diff mbox

Patch

diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c
index 1114428f33..53c09edced 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -1828,6 +1828,9 @@  static av_cold int decode_close_mp3on4(AVCodecContext * avctx)
     MP3On4DecodeContext *s = avctx->priv_data;
     int i;
 
+    if (s->mp3decctx[0])
+        av_freep(&s->mp3decctx[0]->fdsp);
+
     for (i = 0; i < s->frames; i++)
         av_freep(&s->mp3decctx[i]);