diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-04-23 10:49:42 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-04-23 10:49:42 +0000 |
commit | 2b6d2b460f3a3857290d404c4a3ff4752f3ae95a (patch) | |
tree | 164a078ec5f8750b17879a18b2a598b9c8ee7596 /src/java/org/apache/fop | |
parent | fcfb10d2ec7797f769ff911e64aaade9de2faf1e (diff) | |
download | xmlgraphics-fop-2b6d2b460f3a3857290d404c4a3ff4752f3ae95a.tar.gz xmlgraphics-fop-2b6d2b460f3a3857290d404c4a3ff4752f3ae95a.zip |
Bugzilla #39285:
Bugfix: Fixed OutOfMemoryException with long data URLs (RFC 2397).
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@396251 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r-- | src/java/org/apache/fop/apps/FOURIResolver.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/apps/FOURIResolver.java b/src/java/org/apache/fop/apps/FOURIResolver.java index 182b49f1b..68eda5825 100644 --- a/src/java/org/apache/fop/apps/FOURIResolver.java +++ b/src/java/org/apache/fop/apps/FOURIResolver.java @@ -72,6 +72,11 @@ public class FOURIResolver public Source resolve(String href, String base) throws javax.xml.transform.TransformerException { + //data URLs can be quite long so don't try to build a File (can lead to problems) + if (href.startsWith("data:")) { + return parseDataURI(href); + } + URL absoluteURL = null; File f = new File(href); if (f.exists()) { @@ -80,8 +85,6 @@ public class FOURIResolver } catch (MalformedURLException mfue) { log.error("Could not convert filename to URL: " + mfue.getMessage(), mfue); } - } else if (href.startsWith("data:")) { - return parseDataURI(href); } else { URL baseURL = toBaseURL(base); if (baseURL == null) { |