Getting an unexpected error when reading a certain Word document.

java.lang.ArrayIndexOutOfBoundsException: 1333
  at org.apache.poi.util.LittleEndian.getNumber(LittleEndian.java:491)
  at org.apache.poi.util.LittleEndian.getInt(LittleEndian.java:139)
  at
org.apache.poi.hwpf.model.types.DOPAbstractType.fillFields(DOPAbstractType.java:229)
  at
org.apache.poi.hwpf.model.DocumentProperties.<init>(DocumentProperties.java:37)
  at org.apache.poi.hwpf.HWPFDocument.<init>(HWPFDocument.java:162)

Running a debugger on fillFields, I can see:
    data: byte[] = [EMAIL PROTECTED]
    offset: int = 1246

The offset it's trying to read is for field_33_docinfo4, and the offset is 0x54 = 84. 84 + 1246 = 1330.

Is it safe to assume that if we reach the end of the array at this point, then the document should have the default values for all subsequent fields? Or am I seeing some sort of real corruption?

Daniel

--
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://www.nuix.com.au/                        Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply via email to