mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +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
|
||||
|
||||
# Limits for testing the leak
|
||||
mem_limit = 2048*1048576
|
||||
mem_limit = 1024*1048576
|
||||
stack_size = 8*1048576
|
||||
iterations = int((mem_limit/stack_size)*2)
|
||||
codecs = dir(Image.core)
|
||||
|
|
|
@ -797,11 +797,11 @@ ImagingJpeg2KDecodeCleanup(ImagingCodecState state) {
|
|||
if (context->error_msg)
|
||||
free ((void *)context->error_msg);
|
||||
|
||||
context->error_msg = NULL;
|
||||
|
||||
if (context->decoder)
|
||||
ImagingIncrementalCodecDestroy(context->decoder);
|
||||
|
||||
context->error_msg = NULL;
|
||||
|
||||
/* Prevent multiple calls to ImagingIncrementalCodecDestroy */
|
||||
context->decoder = NULL;
|
||||
|
||||
|
|
|
@ -555,6 +555,7 @@ ImagingJpeg2KEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes)
|
|||
INCREMENTAL_CODEC_WRITE,
|
||||
seekable,
|
||||
context->fd);
|
||||
|
||||
if (!context->encoder) {
|
||||
state->errcode = IMAGING_CODEC_BROKEN;
|
||||
state->state = J2K_STATE_FAILED;
|
||||
|
@ -589,7 +590,6 @@ ImagingJpeg2KEncodeCleanup(ImagingCodecState state) {
|
|||
/* Prevent multiple calls to ImagingIncrementalCodecDestroy */
|
||||
context->encoder = NULL;
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user