Skip to content

Commit

Permalink
quartztext: handle invalid text colors
Browse files Browse the repository at this point in the history
  • Loading branch information
fkuehne committed Sep 29, 2013
1 parent 13e35ed commit ba03409
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/text_renderer/quartztext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ba03409

Please sign in to comment.