Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
1.0-alpha3
Description
The following snippet will cause an OOM as it tries to allocate a huge byte-array.
byte[] input = java.util.Base64.getDecoder().decode("iVBORw0KGgoAAAAbaUNDUMlDQyCrbAAtGHZwQWdQyUNDIKtsAAAYiVBORw0KGgp1AAAASURBVA0KGgoAAAANSUhEUgAAACAAIAQACAJ/2QAAsnMAAAAAAElFTkRCYAAY"); Imaging.getAllBufferedImages(input);
All such allocations should be guarded by some limits, see e.g. https://poi.apache.org/apidocs/dev/org/apache/poi/util/IOUtils.html#safelyAllocate-long-int- for how Apache POI supports a configurable limit for allocations.