Created attachment 30854 [details] Patch extending the accepted identifier range to include 0 XWPF documents using identifiers starting with 0 will currently fail with: "IllegalArgumentException: Value for parameter 'id' was out of bounds". This is due to the IdentifierManager being initialized for IDs starting at 1. Documents from LibreOffice (at least 4.0.4.2 and 4.1.1) may use IDs starting at 0. (AFAIU IDs get used for objects embedded into the documents, i.e. pictures.) See also http://stackoverflow.com/questions/18756484/getting-illegalarguementexception-value-for-parameter-id-was-out-of-bounds With the attached trivial patch, POI/XWPF worked correctly for such documents here.
Is there any reason this hasn't been patched already?
This is pending a unit test, along with a very small file that shows the problem, which can be used to check that the problem is fixed by the bug + remains fixed into the future
The following document breaks it: calibre-ebook.com/downloads/demos/demo.docx
Do you know what license that file is under? We can only accept test files that are either under the ASLv2, or explicitly contributed to us by the author
This was already fixed a while ago via github-18 - Handle documents with a picture-only header, see r1661908 for details