Bug 57820 - poi-scratchpad org.apache.poi.hslf.model.Table.initTable NullPointerException
Summary: poi-scratchpad org.apache.poi.hslf.model.Table.initTable NullPointerException
Alias: None
Product: POI
Classification: Unclassified
Component: HSLF (show other bugs)
Version: 3.11-FINAL
Hardware: PC All
: P2 major (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2015-04-16 08:35 UTC by Jon Scharff
Modified: 2015-04-18 04:16 UTC (History)
1 user (show)

powerpoint with a table positioned with its top at -1 (108.00 KB, application/vnd.ms-powerpoint)
2015-04-16 08:35 UTC, Jon Scharff
[patch] (made with ant -f patch.xml) (28.99 KB, patch)
2015-04-17 02:52 UTC, Jon Scharff
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.