6888215: memory leak in jpeg plugin
Reviewed-by: igor, prr
This commit is contained in:
parent
40cd71a7b7
commit
f9f22a5e0b
@ -1437,6 +1437,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader
|
||||
JNU_ThrowByName( env,
|
||||
"java/lang/OutOfMemoryError",
|
||||
"Initializing Reader");
|
||||
free(cinfo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1473,6 +1474,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader
|
||||
JNU_ThrowByName(env,
|
||||
"java/lang/OutOfMemoryError",
|
||||
"Initializing Reader");
|
||||
imageio_dispose((j_common_ptr)cinfo);
|
||||
return 0;
|
||||
}
|
||||
cinfo->src->bytes_in_buffer = 0;
|
||||
@ -1489,6 +1491,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_initJPEGImageReader
|
||||
JNU_ThrowByName( env,
|
||||
"java/lang/OutOfMemoryError",
|
||||
"Initializing Reader");
|
||||
imageio_dispose((j_common_ptr)cinfo);
|
||||
return 0;
|
||||
}
|
||||
return (jlong) ret;
|
||||
@ -2420,8 +2423,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_initJPEGImageWriter
|
||||
JNU_ThrowByName( env,
|
||||
"java/lang/OutOfMemoryError",
|
||||
"Initializing Writer");
|
||||
free(cinfo);
|
||||
free(jerr);
|
||||
imageio_dispose((j_common_ptr)cinfo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -2439,8 +2441,7 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageWriter_initJPEGImageWriter
|
||||
JNU_ThrowByName( env,
|
||||
"java/lang/OutOfMemoryError",
|
||||
"Initializing Writer");
|
||||
free(cinfo);
|
||||
free(jerr);
|
||||
imageio_dispose((j_common_ptr)cinfo);
|
||||
return 0;
|
||||
}
|
||||
return (jlong) ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user