From ba03409b00de69f0aacb9258d5fc74e8a1aa0e58 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20Paul=20K=C3=BChne?= Date: Sun, 29 Sep 2013 14:23:04 +0200 Subject: [PATCH] quartztext: handle invalid text colors --- modules/text_renderer/quartztext.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/text_renderer/quartztext.c b/modules/text_renderer/quartztext.c index 837f02cf16..809d7c7640 100644 --- a/modules/text_renderer/quartztext.c +++ b/modules/text_renderer/quartztext.c @@ -593,7 +593,11 @@ static void setFontAttibutes(char *psz_fontname, int i_font_size, uint32_t i_fon slant); CFRelease(slant); - // Handle foreground colour + // fetch invalid colors + if (i_font_color == 0xFFFFFFFF) + i_font_color = 0x00FFFFFF; + + // Handle foreground color CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB(); CGFloat components[] = { (float)((i_font_color & 0x00ff0000) >> 16) / 255.0, (float)((i_font_color & 0x0000ff00) >> 8) / 255.0, -- 2.11.4.GIT