summaryrefslogtreecommitdiffstats
path: root/src/base/ftbitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/ftbitmap.c')
-rw-r--r--src/base/ftbitmap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c
index 975818e..182b1cc 100644
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -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*.