Hi!

With this small modification files attached here loads correctly.
I'm ignoring values which are outside the specification range (1-31680).

Szabolcs
                                          
From 4a17bf3d26fdf75cb504daa41364eeb7fe970e88 Mon Sep 17 00:00:00 2001
From: Szabolcs Dezsi <[email protected]>
Date: Thu, 8 Mar 2012 14:30:48 +0100
Subject: [PATCH] Opening certain .doc files crashes LO

---
 sw/source/filter/ww8/ww8par6.cxx |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 2ca90194..7de87dd 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -306,7 +306,8 @@ void SwWW8ImplReader::SetDocumentGrid(SwFrmFmt &rFmt, const wwSection &rSection)
     }
 
     aGrid.SetBaseWidth( writer_cast<sal_uInt16>(nCharWidth));
-    aGrid.SetLines(writer_cast<sal_uInt16>(nTextareaHeight/nLinePitch));
+    if( nLinePitch >= 1 && nLinePitch <= 31680 )
+        aGrid.SetLines(writer_cast<sal_uInt16>(nTextareaHeight/nLinePitch));
     aGrid.SetBaseHeight(writer_cast<sal_uInt16>(nLinePitch));
 
     sal_Int32 nRubyHeight = 0;
-- 
1.7.7

_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to