Bug 166862 - Repairing a generated ODT, which is obviously an invalid ZIP package, loses an image in it
Summary: Repairing a generated ODT, which is obviously an invalid ZIP package, loses a...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.8.0 target:25.2.5
Keywords:
: 166938 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-06-05 04:32 UTC by Mike Kaganski
Modified: 2025-06-10 13:53 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
A document in an invalid ZIP package, reportedly generated by Dolibarr (85.19 KB, application/vnd.oasis.opendocument.text)
2025-06-05 04:32 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2025-06-05 04:32:47 UTC
Created attachment 201105 [details]
A document in an invalid ZIP package, reportedly generated by Dolibarr

Ref: https://ask.libreoffice.org/t/all-odt-files-corrupt/95821/8

The attachment is said to be generated by Dolibarr. It is reported corrupt by LibreOffice versions 24.8+; and can be repaired, when confirmed; but the problem is, that the repaired document misses an image in the header (it shows a "Read Error" in its placeholder).

Manually unpacking the package, and packing back unmodified, shows the image OK. Opening it using version 24.2 and earlier, also gives the image. So the bug is, that repairing should restore content correctly.
Comment 1 Mike Kaganski 2025-06-05 04:38:19 UTC
What's confusing is that its meta claims it to be generated by LO 25.2. Unrelated to this specific problem; but can we really generate such broken packages ourselves?
Comment 2 Commit Notification 2025-06-07 11:52:28 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9727cf785945218a4f06562f4edb657551d25436

tdf#166862: fix reading data for CRC calculation

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2025-06-09 09:25:55 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/90146f70bf3840a7f093cebed4f5857329eea42d

tdf#166862: fix reading data for CRC calculation

It will be available in 25.2.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Mike Kaganski 2025-06-10 13:53:54 UTC
*** Bug 166938 has been marked as a duplicate of this bug. ***