mirror of
https://github.com/apache/poi.git
synced 2025-02-12 13:04:50 +00:00
Bug 66425: Avoid exceptions found via poi-fuzz
Prevent NullPointerException Fixes https://issues.oss-fuzz.com/issues/389724915 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1923276 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9c24944299
commit
dd647b5d2d
@ -84,9 +84,14 @@ public class XSLFGraphicFrame extends XSLFShape implements GraphicalFrame<XSLFSh
|
||||
}
|
||||
double x = Units.toPoints(POIXMLUnits.parseLength(off.xgetX()));
|
||||
double y = Units.toPoints(POIXMLUnits.parseLength(off.xgetY()));
|
||||
|
||||
CTPositiveSize2D ext = xfrm.getExt();
|
||||
if (ext == null) {
|
||||
throw new IllegalArgumentException("Could not retrieve Ext from the XML object");
|
||||
}
|
||||
double cx = Units.toPoints(ext.getCx());
|
||||
double cy = Units.toPoints(ext.getCy());
|
||||
|
||||
return new Rectangle2D.Double(x, y, cx, cy);
|
||||
}
|
||||
|
||||
|
@ -448,6 +448,10 @@ public abstract class XSLFShape implements Shape<XSLFShape,XSLFTextParagraph> {
|
||||
// values 1-999 refer to the index of a fill style within the fillStyleLst element
|
||||
// values 1001 and above refer to the index of a background fill style within the bgFillStyleLst element.
|
||||
long idx = fillRef.getIdx();
|
||||
|
||||
if (theme == null || theme.getXmlObject() == null || theme.getXmlObject().getThemeElements() == null) {
|
||||
throw new IllegalArgumentException("Could not retrieve theme elements from shape");
|
||||
}
|
||||
CTStyleMatrix matrix = theme.getXmlObject().getThemeElements().getFmtScheme();
|
||||
final XmlObject styleLst;
|
||||
long childIdx;
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user