From a49aa4c2b2bbda63e825ac365d7df4225831a70b Mon Sep 17 00:00:00 2001 From: Evan Deaubl Date: Mon, 30 Aug 2004 19:28:43 +0000 Subject: [PATCH] Stop processing input stream when the outermost RTF group is closed. --- dlls/richedit/reader.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/richedit/reader.c b/dlls/richedit/reader.c index 7a7e6b706b6..1e74d88e1e5 100644 --- a/dlls/richedit/reader.c +++ b/dlls/richedit/reader.c @@ -540,10 +540,20 @@ RTFFont *fp; info->csStack[info->csTop++] = info->curCharSet; break; case rtfEndGroup: + /* + * If stack top is 1 at this point, we are ending the + * group started by the initial {, which ends the + * RTF stream + */ if (info->csTop <= 0) RTFPanic (info,"_RTFGetToken: stack underflow"); - info->curCharSet = info->csStack[--info->csTop]; - RTFSetCharSet (info, info->curCharSet); + else if (info->csTop == 1) + info->rtfClass = rtfEOF; + else + { + info->curCharSet = info->csStack[--info->csTop]; + RTFSetCharSet (info, info->curCharSet); + } break; } }