From fba3b6d1979c1d1ad0d56d46fc2d787f111c07fb Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 26 Jun 2014 09:46:14 +0200 Subject: Updated to freetype 2.5.3 --- freetype/src/base/ftbitmap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'freetype/src/base/ftbitmap.c') diff --git a/freetype/src/base/ftbitmap.c b/freetype/src/base/ftbitmap.c index 975818e14..5606745be 100644 --- a/freetype/src/base/ftbitmap.c +++ b/freetype/src/base/ftbitmap.c @@ -4,7 +4,7 @@ /* */ /* FreeType utility functions for bitmaps (body). */ /* */ -/* Copyright 2004-2009, 2011, 2013 by */ +/* Copyright 2004-2009, 2011, 2013, 2014 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -375,7 +375,7 @@ } - FT_Byte + static FT_Byte ft_gray_for_premultiplied_srgb_bgra( const FT_Byte* bgra ) { FT_Long a = bgra[3]; @@ -385,6 +385,10 @@ FT_Long l; + /* Short-circuit transparent color to avoid div-by-zero. */ + if ( !a ) + return 0; + /* * Luminosity for sRGB is defined using ~0.2126,0.7152,0.0722 * coefficients for RGB channels *on the linear colors*. -- cgit v1.2.3