From 9eda99c0bb064ead14ece835a75bd8df5f76e63d Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Mon, 9 Oct 2006 20:11:32 +0900 Subject: [PATCH] riched20: Don't crash if a colour isn't found. --- dlls/riched20/editor.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index e3383f2e596..e0ba4e975d8 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -377,7 +377,10 @@ static void ME_RTFCharAttrHook(RTF_Info *info) else if (info->rtfParam != rtfNoParam) { RTFColor *c = RTFGetColor(info, info->rtfParam); - fmt.crTextColor = (c->rtfCBlue<<16)|(c->rtfCGreen<<8)|(c->rtfCRed); + if (c) + fmt.crTextColor = (c->rtfCBlue<<16)|(c->rtfCGreen<<8)|(c->rtfCRed); + else + fmt.crTextColor = 0; } break; case rtfFontNum: