riched20: Don't crash if a colour isn't found.

This commit is contained in:
Mike McCormack 2006-10-09 20:11:32 +09:00 committed by Alexandre Julliard
parent 8b9ad4d3bc
commit 9eda99c0bb

View File

@ -377,7 +377,10 @@ static void ME_RTFCharAttrHook(RTF_Info *info)
else if (info->rtfParam != rtfNoParam) else if (info->rtfParam != rtfNoParam)
{ {
RTFColor *c = RTFGetColor(info, info->rtfParam); RTFColor *c = RTFGetColor(info, info->rtfParam);
if (c)
fmt.crTextColor = (c->rtfCBlue<<16)|(c->rtfCGreen<<8)|(c->rtfCRed); fmt.crTextColor = (c->rtfCBlue<<16)|(c->rtfCGreen<<8)|(c->rtfCRed);
else
fmt.crTextColor = 0;
} }
break; break;
case rtfFontNum: case rtfFontNum: