[vlc-devel] commit: freetype: potential divide by zero crash. (Derk-Jan Hartman )
git version control
git at videolan.org
Fri Sep 12 13:21:29 CEST 2008
vlc | branch: 0.9-bugfix | Derk-Jan Hartman <hartman at videolan.org> | Fri Sep 12 13:13:46 2008 +0200| [08b5c5b27460d23b8b25a8ba411fffc012555987] | committer: Derk-Jan Hartman
freetype: potential divide by zero crash.
(cherry picked from commit cdc8bcd3e5ed868589e16e5014246a4ccc3b512e)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=08b5c5b27460d23b8b25a8ba411fffc012555987
---
modules/misc/freetype.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c
index d7c93f5..8d42bc0 100644
--- a/modules/misc/freetype.c
+++ b/modules/misc/freetype.c
@@ -2939,9 +2939,12 @@ static int GetFontSize( filter_t *p_filter )
else
{
var_Get( p_filter, "freetype-rel-fontsize", &val );
- i_size = (int)p_filter->fmt_out.video.i_height / val.i_int;
- p_filter->p_sys->i_display_height =
- p_filter->fmt_out.video.i_height;
+ if( val.i_int > 0 )
+ {
+ i_size = (int)p_filter->fmt_out.video.i_height / val.i_int;
+ p_filter->p_sys->i_display_height =
+ p_filter->fmt_out.video.i_height;
+ }
}
if( i_size <= 0 )
{
More information about the vlc-devel
mailing list