6874643: ImageI/O JPEG is vulnerable to Heap Overflow

Reviewed-by: prr, hawtin
This commit is contained in:
Andrew Brygin 2009-09-10 12:26:34 +04:00
parent 5456677e02
commit 67e3ba76c1

View File

@ -1833,6 +1833,13 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
return JNI_FALSE;
}
if (stepX > cinfo->image_width) {
stepX = cinfo->image_width;
}
if (stepY > cinfo->image_height) {
stepY = cinfo->image_height;
}
/*
* First get the source bands array and copy it to our local array
* so we don't have to worry about pinning and unpinning it again.