Bug 57820

Summary: poi-scratchpad org.apache.poi.hslf.model.Table.initTable NullPointerException
Product: POI Reporter: Jon Scharff <jon_s>
Component: HSLFAssignee: POI Developers List <dev>
Severity: major CC: jon_s
Priority: P2    
Version: 3.11-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: powerpoint with a table positioned with its top at -1
[patch] (made with ant -f patch.xml)

Description Jon Scharff 2015-04-16 08:35:11 UTC
Created attachment 32654 [details]
powerpoint with a table positioned with its top at -1

org.apache.poi.hslf.model.Table.initTable is making the invalid assumption (it seems) that -1 will not be a y value for a shape's anchor rectangle. If the table is located such that it's top evaluates to -1, then row is null at line 174 (row.add(sh[i])), causing an NullPointerException to occur.

run org.apache.poi.hslf.extractor.PowerPointExtractor passing the filename of the attached powerpoint as an argument.
Comment 1 Jon Scharff 2015-04-17 02:52:24 UTC
Created attachment 32656 [details]
[patch] (made with ant -f patch.xml)

includes a ppt that exhibits the issue in test-data/slideshow (same as attachment 32654 [details]), a test added to model.TestTable and a fix to model.Table.
Comment 2 Jon Scharff 2015-04-17 02:54:01 UTC
Forgot to add that the patch was made on the trunk.
Comment 3 Nick Burch 2015-04-18 04:16:51 UTC
Thanks! Patch applied in r1674441.