https://issues.apache.org/bugzilla/show_bug.cgi?id=51945

             Bug #: 51945
           Summary: [BUG] StyleSheet getCharacterStyle ArrayIndex OOB -
                    Negative style number
           Product: POI
           Version: 3.8-dev
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HWPF
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


Unable to include sample document due to sensitive nature.

Somehow one of my documents is ending up with a negative style index.  File
opens successfully in Word 2010, and appears to be a Wrod97-2003 document.

I tried adding an OR check with the greater than length to return NULL values
when the index was less than zero. But it would then fail on the
getStyleDescription() call.

if ( styleIndex >= _styleDescriptions.length || styleIndex  < 0)
{
   return NIL_CHP;
}

Stack Trace (Daily Build):
Caused by: java.lang.ArrayIndexOutOfBoundsException: -2560
    at
org.apache.poi.hwpf.model.StyleSheet.getCharacterStyle(StyleSheet.java:325)
    at org.apache.poi.hwpf.model.CHPX.getCharacterProperties(CHPX.java:74)
    at org.apache.poi.hwpf.usermodel.CharacterRun.<init>(CharacterRun.java:98)
    at org.apache.poi.hwpf.usermodel.Range.getCharacterRun(Range.java:853)
    at
org.apache.poi.hwpf.model.PicturesTable.getAllPictures(PicturesTable.java:208)
    at
org.apache.tika.parser.microsoft.WordExtractor$PicturesSource.<init>(WordExtractor.java:502)
    at
org.apache.tika.parser.microsoft.WordExtractor$PicturesSource.<init>(WordExtractor.java:492)
    at
org.apache.tika.parser.microsoft.WordExtractor.parse(WordExtractor.java:81)
    at
org.apache.tika.parser.microsoft.OfficeParser.parse(OfficeParser.java:200)
    at org.apache.tika.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to