Skip to content

Commit 25c1ac8

Browse files
committed
PDFBOX-5999: fix initial ByteArrayOutputStream size as proposed by Axel Howind
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1925393 13f79535-47bb-0310-9956-ffa450edef68
1 parent 55abbc7 commit 25c1ac8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/src/main/java/org/apache/pdfbox/tools/imageio/ImageIOUtil.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ private static byte[] getAsDeflatedBytes(ICC_Profile profile) throws IOException
350350
{
351351
byte[] data = profile.getData();
352352

353-
ByteArrayOutputStream deflated = new ByteArrayOutputStream(Math.max(32, 2 * data.length));
353+
ByteArrayOutputStream deflated = new ByteArrayOutputStream(Math.max(32, data.length / 2));
354354
try (DeflaterOutputStream deflater = new DeflaterOutputStream(deflated))
355355
{
356356
deflater.write(data);

0 commit comments

Comments
 (0)