You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ax...@apache.org on 2022/01/10 14:37:13 UTC
svn commit: r1896887 - /poi/trunk/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java
Author: axh
Date: Mon Jan 10 14:37:13 2022
New Revision: 1896887
URL: http://svn.apache.org/viewvc?rev=1896887&view=rev
Log:
Bug 65796: License violation in PICT.java
Modified:
poi/trunk/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java
Modified: poi/trunk/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java?rev=1896887&r1=1896886&r2=1896887&view=diff
==============================================================================
--- poi/trunk/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java (original)
+++ poi/trunk/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java Mon Jan 10 14:37:13 2022
@@ -23,6 +23,7 @@ import java.awt.Dimension;
import java.io.ByteArrayInputStream;
import java.io.EOFException;
import java.io.IOException;
+import java.util.Arrays;
import java.util.zip.InflaterInputStream;
import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream;
@@ -99,7 +100,7 @@ public final class PICT extends Metafile
out.write(chunk, 0, count);
// PICT zip-stream can be erroneous, so we clear the array to determine
// the maximum of read bytes, after the inflater crashed
- bytefill(chunk, (byte) 0);
+ Arrays.fill(chunk, (byte) 0);
}
} catch (Exception e) {
int lastLen = chunk.length - 1;
@@ -186,22 +187,4 @@ public final class PICT extends Metafile
throw new IllegalArgumentException(signature+" is not a valid instance/signature value for PICT");
}
}
-
-
- /*
- * initialize a smaller piece of the array and use the System.arraycopy
- * call to fill in the rest of the array in an expanding binary fashion
- */
- private static void bytefill(byte[] array, byte value) {
- // http://stackoverflow.com/questions/9128737/fastest-way-to-set-all-values-of-an-array
- int len = array.length;
-
- if (len > 0){
- array[0] = value;
- }
-
- for (int i = 1; i < len; i += i) {
- System.arraycopy(array, 0, array, i, Math.min(len - i, i));
- }
- }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org