mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
Avoid NPE with broken file
This commit is contained in:
parent
c28aec61d4
commit
0ec4434f59
@ -408,11 +408,13 @@ public abstract class HSLFShape implements Shape<HSLFShape,HSLFTextParagraph> {
|
||||
if (fSchemeIndex && sheet != null) {
|
||||
//red is the index to the color scheme
|
||||
ColorSchemeAtom ca = sheet.getColorScheme();
|
||||
int schemeColor = ca.getColor(ecr.getSchemeIndex());
|
||||
if (ca != null) {
|
||||
int schemeColor = ca.getColor(ecr.getSchemeIndex());
|
||||
|
||||
rgb[0] = (schemeColor >> 0) & 0xFF;
|
||||
rgb[1] = (schemeColor >> 8) & 0xFF;
|
||||
rgb[2] = (schemeColor >> 16) & 0xFF;
|
||||
rgb[0] = (schemeColor >> 0) & 0xFF;
|
||||
rgb[1] = (schemeColor >> 8) & 0xFF;
|
||||
rgb[2] = (schemeColor >> 16) & 0xFF;
|
||||
}
|
||||
} else if (fPaletteIndex) {
|
||||
//TODO
|
||||
} else if (fPaletteRGB) {
|
||||
|
||||
@ -1665,6 +1665,9 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText
|
||||
return null;
|
||||
}
|
||||
ColorSchemeAtom ca = sheet.getColorScheme();
|
||||
if (ca == null) {
|
||||
throw new IllegalStateException("Cannot read color scheme from sheet");
|
||||
}
|
||||
tmp = new Color(ca.getColor(cidx), true);
|
||||
break;
|
||||
// Color is an sRGB value specified by red, green, and blue fields.
|
||||
|
||||
@ -37,6 +37,7 @@ public class TestPPTXMLDump extends BaseTestPPTIterating {
|
||||
LOCAL_EXCLUDED.add("clusterfuzz-testcase-minimized-POIHSLFFuzzer-6360479850954752.ppt");
|
||||
LOCAL_EXCLUDED.add("ppt_with_png_encrypted.ppt");
|
||||
LOCAL_EXCLUDED.add("clusterfuzz-testcase-minimized-POIHSLFFuzzer-6614960949821440.ppt");
|
||||
LOCAL_EXCLUDED.add("60f557c0a46bcb0068b1c3e15589dac383307bc8.ppt");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@ -39,6 +39,7 @@ public class TestSlideShowDumper extends BaseTestPPTIterating {
|
||||
FAILING.add("41384.ppt");
|
||||
FAILING.add("bug56240.ppt");
|
||||
FAILING.add("clusterfuzz-testcase-minimized-POIHSLFFuzzer-6360479850954752.ppt");
|
||||
FAILING.add("60f557c0a46bcb0068b1c3e15589dac383307bc8.ppt");
|
||||
}
|
||||
|
||||
static final Set<String> LOCAL_EXCLUDED = new HashSet<>();
|
||||
|
||||
BIN
test-data/slideshow/60f557c0a46bcb0068b1c3e15589dac383307bc8.ppt
Normal file
BIN
test-data/slideshow/60f557c0a46bcb0068b1c3e15589dac383307bc8.ppt
Normal file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user