https://bugs.documentfoundation.org/show_bug.cgi?id=173869

            Bug ID: 173869
           Summary: FILEOPEN: Compound File Binary version 4 (4096-byte
                    sectors) rejected - PPT/DOC fail to load, XLS opens as
                    garbage text
           Product: LibreOffice
           Version: 26.2.6.3 release
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: filters and storage
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 208939
  --> https://bugs.documentfoundation.org/attachment.cgi?id=208939&action=edit
File that doesn't work

LibreOffice cannot open legacy binary Office files (.ppt/.doc/.xls) stored in
an MS-CFB major version 4 container (4096-byte sectors). Such files exist in
the wild, e.g. presentations whose metadata names "Microsoft Macintosh
PowerPoint" as the creating application.

The attached test-v3.ppt and test-v4.ppt contain byte-identical streams; only
the container version differs. v3 opens fine; v4 gives "Error: source file
could not be loaded" with --convert-to. Same for .doc. For .xls, detection
falls through to the text filter and Calc shows the raw binary as text.

Steps to reproduce:
soffice --headless --convert-to pdf test-v4.ppt

Expected: one slide reading "CFB v4 test slide", as with test-v3.ppt.

Cause: StgHeader::Check() only accepts major version 3 with 512-byte sectors:
https://github.com/LibreOffice/core/blob/9609c61799b2565e4f718a82147569a2bec0ba23/sot/source/sdstor/stgelem.cxx#L194-L207
Parts of the reader (e.g. StgCache::Page2Pos) already handle other sector
sizes, so read support may mostly need this check relaxed. I have not tested a
patch.

Workaround: re-pack the file as CFB v3 (test-v3.ppt was made that way).

Version: 26.2.6.3, Fedora 44 x86_64

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to