diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-22 01:03:11 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-22 01:06:44 -0500 |
commit | f2972242673cc9608960e9ca70e82766be5275e3 (patch) | |
tree | a5cd8eca99cf77cb42bca549e7e91a01ad3249a2 | |
parent | 8061b40349c1251362c984b76aaa90b9510fba4f (diff) |
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.
-rw-r--r-- | sc/source/filter/excel/read.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index d68fc5147b34..8b7eacaae142 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; |