Cleaning up.

Reduced memory limit to 1GB
This commit is contained in:
Josh Ware 2014-08-28 21:33:18 +10:00 committed by wiredfool
parent dd221d9ec0
commit 94194ed248
4 changed files with 28 additions and 28 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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;
}