From f13abef6cccbe91ee894511e4abf7322b276edec Mon Sep 17 00:00:00 2001 From: Gilles Boccon-Gibod Date: Fri, 1 Mar 2024 09:44:18 -0800 Subject: [PATCH] fix leak --- Source/C++/Core/Ap4EsdsAtom.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/C++/Core/Ap4EsdsAtom.cpp b/Source/C++/Core/Ap4EsdsAtom.cpp index 58f4ee97a..5377a10d7 100644 --- a/Source/C++/Core/Ap4EsdsAtom.cpp +++ b/Source/C++/Core/Ap4EsdsAtom.cpp @@ -76,6 +76,9 @@ AP4_EsdsAtom::AP4_EsdsAtom(AP4_UI32 size, if (AP4_DescriptorFactory::CreateDescriptorFromStream(stream, descriptor) == AP4_SUCCESS) { m_EsDescriptor = AP4_DYNAMIC_CAST(AP4_EsDescriptor, descriptor); + if (!m_EsDescriptor) { + delete descriptor; + } } else { m_EsDescriptor = NULL; }