This commit is contained in:
Phil Race 2018-01-19 09:32:10 -08:00
commit eb5804b42e
330 changed files with 6804 additions and 3666 deletions

View file

@ -127,6 +127,18 @@ public class ICC_ColorSpace extends ColorSpace {
setMinMax();
}
/**
* Validate an ICC_ColorSpace read from an object input stream
*/
private void readObject(java.io.ObjectInputStream s)
throws ClassNotFoundException, java.io.IOException {
s.defaultReadObject();
if (thisProfile == null) {
thisProfile = ICC_Profile.getInstance(ColorSpace.CS_sRGB);
}
}
/**
* Returns the ICC_Profile for this ICC_ColorSpace.
* @return the ICC_Profile for this ICC_ColorSpace.

View file

@ -25,13 +25,14 @@
package java.awt.geom;
import java.awt.Shape;
import java.awt.Rectangle;
import sun.awt.geom.Curve;
import java.awt.Shape;
import java.io.Serializable;
import java.io.StreamCorruptedException;
import java.util.Arrays;
import sun.awt.geom.Curve;
/**
* The {@code Path2D} class provides a simple, yet flexible
* shape which represents an arbitrary geometric path.
@ -2625,9 +2626,12 @@ public abstract class Path2D implements Shape, Cloneable {
throw new java.io.InvalidObjectException(iae.getMessage());
}
pointTypes = new byte[(nT < 0) ? INIT_SIZE : nT];
if (nC < 0) {
nC = INIT_SIZE * 2;
// Accept the size from the stream only if it is less than INIT_SIZE
// otherwise the size will be based on the real data in the stream
pointTypes = new byte[(nT < 0 || nT > INIT_SIZE) ? INIT_SIZE : nT];
final int initX2 = INIT_SIZE * 2;
if (nC < 0 || nC > initX2) {
nC = initX2;
}
if (storedbl) {
((Path2D.Double) this).doubleCoords = new double[nC];