]> git.sesse.net Git - vlc/commitdiff
freetype.c: don't hang if user specify negative fontsize
authorSigmund Augdal Helberg <sigmunau@videolan.org>
Tue, 7 Sep 2004 10:34:47 +0000 (10:34 +0000)
committerSigmund Augdal Helberg <sigmunau@videolan.org>
Tue, 7 Sep 2004 10:34:47 +0000 (10:34 +0000)
modules/misc/freetype.c

index 405a8c268f1dadf352b7609b91376d83dffdb680..69a557b4f9a07848f6c4fce551cd0b8eade0f7aa 100644 (file)
@@ -246,6 +246,11 @@ static int Create( vlc_object_t *p_this )
         var_Get( p_filter, "freetype-rel-fontsize", &val );
         i_fontsize = (int)p_filter->fmt_out.video.i_height / val.i_int;
     }
+    if( i_fontsize <= 0 )
+    {
+        msg_Warn( p_filter, "Invalid fontsize, using 12" );
+        i_fontsize = 12;
+    }
     msg_Dbg( p_filter, "Using fontsize: %i", i_fontsize);
 
     i_error = FT_Set_Pixel_Sizes( p_sys->p_face, 0, i_fontsize );