DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34727>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34727

           Summary: Exception thrown when trying to retrieve Font Field
           Product: POI
           Version: 2.0FINAL
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


>From tracing the code, it seems that a FontRecord is created with byte 14 > 0
which in turn causes
field_10_font_name_len  > 0 causing unicode decoding code to be invoked which
produces the exception itself. I've followed the codepath and the data array is
filled directly from the inputstream, retrieving a +ve 124 for data[14].

Caused by: java.lang.IllegalArgumentException: Illegal length
    at org.apache.poi.util.StringUtil.getFromUnicodeLE(StringUtil.java:78)
    at org.apache.poi.hssf.record.FontRecord.fillFields(FontRecord.java:146)
    at org.apache.poi.hssf.record.Record.fillFields(Record.java:91)
    at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
    at org.apache.poi.hssf.record.FontRecord.<init>(FontRecord.java:88)
    ... 25 more

The exception is thrown in getFromUnicodeLE but i havent encountered that method
usually being called to begin with. 

The font used itself is Arial so i'm not sure why its causing a problem.

The value for data[14]=124
The value for data[15]=109

Also when the getFromUnicodeLE function is called, the length of the byte array
titled string is 26 , the offset passed is 16 and the len paramater is 124. 
Printing out the function  header 
getFromUnicodeLE(final byte[] string,final int offset,final int len)
and I get getFromUnicodeLE([EMAIL PROTECTED],16,124)

Also I got the same problem with 2.0 FINAL and the HEAD version I checked out
from CVS

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
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