changeset 32556:34215c3e6e10

Check the validity of an argument, font. If opening a font file when using -ass fails, 'font' becomes NULL and causes MPlayer to crash.
author komh
date Tue, 23 Nov 2010 14:44:26 +0000
parents 8a556b3aff79
children 683199947822
files libass/ass_drawing.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libass/ass_drawing.c	Sun Nov 21 19:46:37 2010 +0000
+++ b/libass/ass_drawing.c	Tue Nov 23 14:44:26 2010 +0000
@@ -367,7 +367,7 @@
     drawing->fontconfig_priv = fontconfig_priv;
     drawing->font = font;
     drawing->ftlibrary = lib;
-    drawing->library = font->library;
+    drawing->library = font ? font->library : NULL;
 
     drawing->scale_x = 1.;
     drawing->scale_y = 1.;