[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Nov 21 22:06:41 PST 2011


 sc/source/filter/excel/read.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit f2972242673cc9608960e9ca70e82766be5275e3
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Tue Nov 22 01:03:11 2011 -0500

    i#115255: Skip invalid record(s) where BOF is expected.
    
    Some 3rd party (Russian?) programs generate broken xls docs which
    cause Calc to hang when it tries to open it.  This particular doc
    placed invalid record at position indicated by BOUNDSHEET, where BOF
    was expected.  Let's skip those invalid records.

diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index d68fc51..8b7eaca 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -848,6 +848,14 @@ FltError ImportExcel8::Read( void )
                 nProgressBaseSize += (aIn.GetSvStreamPos() - nProgressBasePos);
                 nProgressBasePos = maSheetOffsets[ nScTab ];
                 aIn.StartNextRecord( nProgressBasePos );
+                while (aIn.GetRecId() != EXC_ID5_BOF)
+                {
+                    // i#115255 Some malformed documents generated by 3rd
+                    // party Russian program(s) occasionally insert non BOF
+                    // record(s) at position indicated by BOUNDSHEET.  Skip
+                    // them.
+                    aIn.StartNextRecord();
+                }
             }
             else
                 eAkt = EXC_STATE_END;


More information about the Libreoffice-commits mailing list