[vlc-devel] commit: Fix segfault when freetype-yuvp is set to 1 in vlcrc. ( Alexis Ballier )

git version control git at videolan.org
Mon Jan 25 23:06:06 CET 2010


vlc/vlc-1.0 | branch: master | Alexis Ballier <aballier at gentoo.org> | Mon Jan 25 22:42:31 2010 +0100| [9e645481698c076bdbb2c808c5652762ec294049] | committer: Jean-Baptiste Kempf 

Fix segfault when freetype-yuvp is set to 1 in vlcrc.

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
(cherry picked from commit a99b43de32abc4aa1d9cf9e046b6ba6753dd2fc1)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.0.git/?a=commit;h=9e645481698c076bdbb2c808c5652762ec294049
---

 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 a23b6aa..99b7a80 100644
--- a/modules/misc/freetype.c
+++ b/modules/misc/freetype.c
@@ -676,6 +676,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
     p_region->p_picture = picture_New( fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect );
     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 */




More information about the vlc-devel mailing list