6804998: JRE GIF Decoding Heap Corruption [V-y6g5jlm8e1]
Reviewed-by: prr
This commit is contained in:
parent
de4c8e0eb5
commit
d033b16582
@ -585,9 +585,16 @@ public class GifImageDecoder extends ImageDecoder {
|
||||
System.out.print("Reading a " + width + " by " + height + " " +
|
||||
(interlace ? "" : "non-") + "interlaced image...");
|
||||
}
|
||||
|
||||
int initCodeSize = ExtractByte(block, 9);
|
||||
if (initCodeSize >= 12) {
|
||||
if (verbose) {
|
||||
System.out.println("Invalid initial code size: " +
|
||||
initCodeSize);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
boolean ret = parseImage(x, y, width, height,
|
||||
interlace, ExtractByte(block, 9),
|
||||
interlace, initCodeSize,
|
||||
block, rasline, model);
|
||||
|
||||
if (!ret) {
|
||||
|
@ -191,6 +191,11 @@ Java_sun_awt_image_GifImageDecoder_parseImage(JNIEnv *env,
|
||||
int passht = passinc;
|
||||
int len;
|
||||
|
||||
/* We have verified the initial code size on the java layer.
|
||||
* Here we just check bounds for particular indexes. */
|
||||
if (freeCode >= 4096 || maxCode >= 4096) {
|
||||
return 0;
|
||||
}
|
||||
if (blockh == 0 || raslineh == 0
|
||||
|| prefixh == 0 || suffixh == 0
|
||||
|| outCodeh == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user