From 831216f609dfb4413dd51559f52b83f6a11f7d0f Mon Sep 17 00:00:00 2001 From: Alastair Houghton Date: Tue, 25 Mar 2014 16:58:44 +0000 Subject: [PATCH] Fixed a Python 3 specific crash. --- libImaging/Jpeg2KEncode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libImaging/Jpeg2KEncode.c b/libImaging/Jpeg2KEncode.c index 2fcc8e586..c1e16e97f 100644 --- a/libImaging/Jpeg2KEncode.c +++ b/libImaging/Jpeg2KEncode.c @@ -327,7 +327,7 @@ j2k_encode_entry(Imaging im, ImagingCodecState state, tile_height = im->ysize; } - if (PySequence_Check(context->quality_layers)) { + if (context->quality_layers && PySequence_Check(context->quality_layers)) { Py_ssize_t len = PySequence_Length(context->quality_layers); Py_ssize_t n; float *pq;