mirror of
https://github.com/apache/poi.git
synced 2026-02-27 12:30:08 +08:00
Avoid NPE in HSSFShapeGroup.setShapeId()
This commit is contained in:
parent
260b22fb09
commit
839ce4a0f4
@ -355,7 +355,11 @@ public class HSSFShapeGroup extends HSSFShape implements HSSFShapeContainer {
|
||||
EscherContainerRecord containerRecord = getEscherContainer().getChildById(EscherContainerRecord.SP_CONTAINER);
|
||||
EscherSpRecord spRecord = containerRecord.getChildById(EscherSpRecord.RECORD_ID);
|
||||
spRecord.setShapeId(shapeId);
|
||||
CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) getObjRecord().getSubRecords().get(0);
|
||||
ObjRecord objRecord = getObjRecord();
|
||||
if (objRecord == null) {
|
||||
throw new IllegalStateException("Did not have an ObjRecord for the HSSFShapeGroup");
|
||||
}
|
||||
CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) objRecord.getSubRecords().get(0);
|
||||
cod.setObjectId((short) (shapeId % 1024));
|
||||
}
|
||||
|
||||
|
||||
@ -139,7 +139,8 @@ class TestDrawingAggregate {
|
||||
!file.getName().equals("clusterfuzz-testcase-minimized-POIHSSFFuzzer-5285517825277952.xls") &&
|
||||
!file.getName().equals("clusterfuzz-testcase-minimized-POIHSSFFuzzer-4977868385681408.xls") &&
|
||||
!file.getName().equals("crash-e329fca9087fe21bca4a80c8bc472a661c98d860.xls") &&
|
||||
!file.getName().equals("cf9f845e73447b092477d0472402a5baea4b8c9f.xls")).
|
||||
!file.getName().equals("cf9f845e73447b092477d0472402a5baea4b8c9f.xls") &&
|
||||
!file.getName().equals("LIBRE_OFFICE-94379-0.zip-57.xls")).
|
||||
map(Arguments::of);
|
||||
}
|
||||
|
||||
|
||||
BIN
test-data/spreadsheet/LIBRE_OFFICE-94379-0.zip-57.xls
Executable file
BIN
test-data/spreadsheet/LIBRE_OFFICE-94379-0.zip-57.xls
Executable file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user