The Destroy callback in quartztext.c leaks memory
The functions Create and Destroy in MobileVLCKit/ImportedSources/vlc/modules/text_renderer/quartztext.c do not mirror each other with respect to the p_sys->psz_font_name variable. In Create, p_sys->psz_font_name the variable is given the name of a font, but in Destroy, that variable is only freed if not building for IOS. Also, the bracket is missing in the non-IOS-build section that iterates over the p_sys->p_fonts array. Essentially, Destroy should look like this:
static void Destroy(vlc_object_t *p_this)
{
filter_t *p_filter = (filter_t *)p_this;
filter_sys_t *p_sys = p_filter->p_sys;
var_DelCallback( p_filter, "quartztext-font", QuartztextCallback, p_sys );
var_DelCallback( p_filter, "quartztext-fontsize", QuartztextCallback, p_sys );
var_DelCallback( p_filter, "quartztext-color", QuartztextCallback, p_sys );
vlc_mutex_destroy( &p_sys->lock );
var_Destroy( p_filter, "quartztext-font" ) ;
var_Destroy( p_filter, "quartztext-fontsize" );
var_Destroy( p_filter, "quartztext-color" );
#ifndef TARGET_OS_IPHONE
if (p_sys->p_fonts) {
for (int k = 0; k < p_sys->i_fonts; k++) {
ATSFontDeactivate(p_sys->p_fonts[k], NULL, kATSOptionFlagsDefault);
}
free(p_sys->p_fonts);
}
#endif
free(p_sys->psz_font_name);
free(p_sys);
}