Browse Source

Fix a potential NPE which can apparently happen in very exotic cases (actually, it rather points to a Java class library bug).

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1095895 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-1_1rc1old
Jeremias Maerki 13 years ago
parent
commit
a7a5c39253
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java

+ 6
- 1
src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java View File

@@ -127,7 +127,12 @@ public abstract class AbstractImageAdapter implements PDFImage {
pdfICCStream = cs.getICCStream();
}
} else {
if (cs == null && desc.startsWith("sRGB")) {
if (cs == null) {
if (desc == null || !desc.startsWith("sRGB")) {
log.warn("The default sRGB profile was indicated,"
+ " but the profile description does not match what was expected: "
+ desc);
}
//It's the default sRGB profile which we mapped to DefaultRGB in PDFRenderer
cs = (PDFICCBasedColorSpace)doc.getResources().getColorSpace(
new PDFName("DefaultRGB"));

Loading…
Cancel
Save