[vlc-devel] [PATCH 1/2] mp4: Return an error if there are no attachments
Hugo Beauzée-Luyssen
hugo at beauzee.fr
Mon Nov 23 14:53:23 CET 2020
Instead of allocating an empty array that wouldn't be freed by the core
---
modules/demux/mp4/mp4.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 30cff828c1..4ccfd88d82 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -2059,6 +2059,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
if( p_sys->i_attachments == -1 )
p_sys->i_attachments = MP4_GetAttachments( p_sys->p_root, &p_sys->pp_attachments );
+ if( !p_sys->i_attachments )
+ return VLC_EGENERIC;
*ppp_attach = calloc( p_sys->i_attachments, sizeof(**ppp_attach ) );
if( !*ppp_attach )
return VLC_ENOMEM;
--
2.29.2
More information about the vlc-devel
mailing list