[vlc-commits] quartztext: handle invalid text colors

Felix Paul Kühne git at videolan.org
Sun Sep 29 14:25:54 CEST 2013


vlc/vlc-2.1 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Sep 29 14:23:04 2013 +0200| [e65cb6be6d5d9deeff1dcb9a6397e020c4fb7217] | committer: Felix Paul Kühne

quartztext: handle invalid text colors

(cherry picked from commit ba03409b00de69f0aacb9258d5fc74e8a1aa0e58)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=e65cb6be6d5d9deeff1dcb9a6397e020c4fb7217
---

 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 837f02c..809d7c7 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,



More information about the vlc-commits mailing list