[vlc-devel] [PATCH] Fix segfault when freetype-yuvp is set to 1 in vlcrc.

Alexis Ballier aballier at gentoo.org
Mon Jan 25 22:42:31 CET 2010


Allocate a palette for the format/region and reuse it. subpicture_region_Delete should take care of freeing it, but please someone double checks this to be sure.

Reported by: Alexander Stein
References: https://bugs.gentoo.org/show_bug.cgi?id=300406
---
 modules/misc/freetype.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c
index c448b1b..eecf373 100644
--- a/modules/misc/freetype.c
+++ b/modules/misc/freetype.c
@@ -638,6 +638,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
     p_region->p_picture = picture_NewFromFormat( &fmt );
     if( !p_region->p_picture )
         return VLC_EGENERIC;
+    fmt.p_palette = p_region->fmt.p_palette ? p_region->fmt.p_palette : malloc(sizeof(*fmt.p_palette));
     p_region->fmt = fmt;
 
     /* Calculate text color components */
-- 
1.6.6.1




More information about the vlc-devel mailing list