From a7a5c39253fdf7a3c709f9af01c6308cb31e9ed1 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Fri, 22 Apr 2011 08:58:55 +0000 Subject: [PATCH] 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 --- .../org/apache/fop/render/pdf/AbstractImageAdapter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java b/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java index d076e6ab9..59d3930f7 100644 --- a/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java +++ b/src/java/org/apache/fop/render/pdf/AbstractImageAdapter.java @@ -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")); -- 2.39.5