From acd8f4caef83c5daf8bea61ace7e5024d192b413 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 15 Sep 2010 11:19:07 +0200 Subject: [PATCH] emf+-crash-fix.diff: emf+ import - fix crash n#361534 --- cppcanvas/source/mtfrenderer/emfplus.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 46f643f2345a..699c2d4cb8d2 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -810,6 +810,10 @@ namespace cppcanvas EMFPBrush* brush = (EMFPBrush*) aObjects [brushIndexOrColor]; EMFP_DEBUG (printf ("EMF+\tbrush fill slot: %d (type: %d)\n", brushIndexOrColor, brush->GetType ())); + // give up in case something wrong happened + if( !brush ) + return; + rState.isFillColorSet = false; rState.isLineColorSet = false; @@ -1019,7 +1023,8 @@ namespace cppcanvas aObjects [index] = NULL; } - switch (flags & 0xff00) { + // not sure yet, what 0x8000 means + switch (flags & 0x7f00) { case EmfPlusObjectTypeBrush: { EMFPBrush *brush;