mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-05 13:43:28 +03:00
Cleaning up.
Reduced memory limit to 1GB
This commit is contained in:
parent
dd221d9ec0
commit
94194ed248
|
@ -4,7 +4,7 @@ from PIL import Image
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
# Limits for testing the leak
|
# Limits for testing the leak
|
||||||
mem_limit = 2048*1048576
|
mem_limit = 1024*1048576
|
||||||
stack_size = 8*1048576
|
stack_size = 8*1048576
|
||||||
iterations = int((mem_limit/stack_size)*2)
|
iterations = int((mem_limit/stack_size)*2)
|
||||||
codecs = dir(Image.core)
|
codecs = dir(Image.core)
|
||||||
|
|
|
@ -797,11 +797,11 @@ ImagingJpeg2KDecodeCleanup(ImagingCodecState state) {
|
||||||
if (context->error_msg)
|
if (context->error_msg)
|
||||||
free ((void *)context->error_msg);
|
free ((void *)context->error_msg);
|
||||||
|
|
||||||
context->error_msg = NULL;
|
|
||||||
|
|
||||||
if (context->decoder)
|
if (context->decoder)
|
||||||
ImagingIncrementalCodecDestroy(context->decoder);
|
ImagingIncrementalCodecDestroy(context->decoder);
|
||||||
|
|
||||||
|
context->error_msg = NULL;
|
||||||
|
|
||||||
/* Prevent multiple calls to ImagingIncrementalCodecDestroy */
|
/* Prevent multiple calls to ImagingIncrementalCodecDestroy */
|
||||||
context->decoder = NULL;
|
context->decoder = NULL;
|
||||||
|
|
||||||
|
|
|
@ -555,6 +555,7 @@ ImagingJpeg2KEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes)
|
||||||
INCREMENTAL_CODEC_WRITE,
|
INCREMENTAL_CODEC_WRITE,
|
||||||
seekable,
|
seekable,
|
||||||
context->fd);
|
context->fd);
|
||||||
|
|
||||||
if (!context->encoder) {
|
if (!context->encoder) {
|
||||||
state->errcode = IMAGING_CODEC_BROKEN;
|
state->errcode = IMAGING_CODEC_BROKEN;
|
||||||
state->state = J2K_STATE_FAILED;
|
state->state = J2K_STATE_FAILED;
|
||||||
|
@ -589,7 +590,6 @@ ImagingJpeg2KEncodeCleanup(ImagingCodecState state) {
|
||||||
/* Prevent multiple calls to ImagingIncrementalCodecDestroy */
|
/* Prevent multiple calls to ImagingIncrementalCodecDestroy */
|
||||||
context->encoder = NULL;
|
context->encoder = NULL;
|
||||||
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user