diff options
author | marha <marha@users.sourceforge.net> | 2014-06-26 09:46:14 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2014-06-26 09:52:19 +0200 |
commit | fba3b6d1979c1d1ad0d56d46fc2d787f111c07fb (patch) | |
tree | a5d678a6e7030ab8114f97ba34ae2f3c37c0c4b3 /freetype/src/base/ftbitmap.c | |
parent | c30d5eefc96925b4bef781806c7a0114eca1b8e0 (diff) | |
download | vcxsrv-fba3b6d1979c1d1ad0d56d46fc2d787f111c07fb.tar.gz vcxsrv-fba3b6d1979c1d1ad0d56d46fc2d787f111c07fb.tar.bz2 vcxsrv-fba3b6d1979c1d1ad0d56d46fc2d787f111c07fb.zip |
Updated to freetype 2.5.3
Diffstat (limited to 'freetype/src/base/ftbitmap.c')
-rw-r--r-- | freetype/src/base/ftbitmap.c | 8 |
1 files changed, 6 insertions, 2 deletions
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*. |