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:
parent
21c32b08d5
commit
f2e7f1e1dd
@ -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.
|
||||
|
@ -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*.
|
||||
|
Loading…
Reference in New Issue
Block a user