mirror of
https://github.com/openjdk/jdk.git
synced 2026-06-02 08:42:39 +00:00
6829549: JVM crash on certain images
Reviewed-by: igor, prr
This commit is contained in:
parent
d78db1b0c7
commit
5ecb6c24be
@ -41,6 +41,7 @@ import java.awt.Rectangle;
|
||||
import java.awt.color.ColorSpace;
|
||||
import java.awt.color.ICC_Profile;
|
||||
import java.awt.color.ICC_ColorSpace;
|
||||
import java.awt.color.CMMException;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.Raster;
|
||||
import java.awt.image.WritableRaster;
|
||||
@ -629,6 +630,17 @@ public class JPEGImageReader extends ImageReader {
|
||||
!java.util.Arrays.equals(oldData, newData))
|
||||
{
|
||||
iccCS = new ICC_ColorSpace(newProfile);
|
||||
// verify new color space
|
||||
try {
|
||||
float[] colors = iccCS.fromRGB(new float[] {1f, 0f, 0f});
|
||||
} catch (CMMException e) {
|
||||
/*
|
||||
* Embedded profile seems to be corrupted.
|
||||
* Ignore this profile.
|
||||
*/
|
||||
iccCS = null;
|
||||
warningOccurred(WARNING_IGNORE_INVALID_ICC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user