2013-07-30 Behdad Esfahbod <behdad@google.com>

Prevent division by zero by a transparent color.

	* src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra):
	Return 0 immediately, when alpha channel is zero.
This commit is contained in:
suzuki toshiya 2013-07-30 13:32:57 +09:00
parent 21c32b08d5
commit f2e7f1e1dd
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2013-07-30 Behdad Esfahbod <behdad@google.com>
Prevent division by zero by a transparent color.
* src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra):
Return 0 immediately, when alpha channel is zero.
2013-07-25 Behdad Esfahbod <behdad@google.com>
Add FT_FACE_FLAG_COLOR and FT_HAS_COLOR.

View File

@ -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*.