aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/iamfdec.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-01-23 09:58:39 -0300
committerJames Almer <jamrial@gmail.com>2024-01-23 09:58:47 -0300
commitb6af126c72e6f2988ca29c189926b20f12ff19de (patch)
tree5ccf65e5ecacfc54ad1620c7fec4322110e64116 /libavformat/iamfdec.c
parenta47072d6434bc26dc3dc7fb85e03439d119b18fb (diff)
downloadffmpeg-b6af126c72e6f2988ca29c189926b20f12ff19de.tar.gz
avformat/iamfdec: free superfluous objects
The AVIAMFAudioElement and AVIAMFMixPresentation that are ultimately used are allocated by ff_iamfdec_read_descriptors(). Fixes some memory leaks reported by Valgrind. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/iamfdec.c')
-rw-r--r--libavformat/iamfdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/iamfdec.c b/libavformat/iamfdec.c
index 28d69b8b3f..3b8d2ff358 100644
--- a/libavformat/iamfdec.c
+++ b/libavformat/iamfdec.c
@@ -404,6 +404,7 @@ static int iamf_read_header(AVFormatContext *s)
if (!stg)
return AVERROR(ENOMEM);
+ av_iamf_audio_element_free(&stg->params.iamf_audio_element);
stg->id = audio_element->audio_element_id;
stg->params.iamf_audio_element = audio_element->element;
@@ -435,6 +436,7 @@ static int iamf_read_header(AVFormatContext *s)
if (!stg)
return AVERROR(ENOMEM);
+ av_iamf_mix_presentation_free(&stg->params.iamf_mix_presentation);
stg->id = mix_presentation->mix_presentation_id;
stg->params.iamf_mix_presentation = mix_presentation->mix;