[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] Avoid div-by-zero in color conversion code
From: |
suzuki toshiya |
Subject: |
Re: [ft-devel] Avoid div-by-zero in color conversion code |
Date: |
Tue, 30 Jul 2013 13:39:45 +0900 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130518 Icedove/17.0.5 |
Werner,
Sorry for my presumptuous behavior, just I've committed
Behdad's patch.
Regards,
mpsuzuki
On 07/30/2013 07:38 AM, Behdad Esfahbod wrote:
> Werner,
>
> Please apply this minor patch:
>
> diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c
> index 975818e..fb09e00 100644
> --- a/src/base/ftbitmap.c
> +++ b/src/base/ftbitmap.c
> @@ -384,6 +384,9 @@
> FT_Long r = bgra[2];
> 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
>
>
> Thanks,
>