From af4300ed8a1b02d288e8d9b7d59e40a5cbbea825 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 27 Jul 2015 15:34:19 +0100 Subject: [PATCH] fix Python new_from_array() under some circumstances it could modify the passed-in array, now it copies --- python/Vips.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/Vips.py b/python/Vips.py index fb9d78ef..6ab68995 100644 --- a/python/Vips.py +++ b/python/Vips.py @@ -442,7 +442,8 @@ def vips_image_new_from_array(cls, array, scale = 1, offset = 0): height = 1 width = len(array) else: - flat_array = array[0] + # must copy the first row, we don't want to modify the passed-in array + flat_array = list(array[0]) height = len(array) width = len(array[0]) for i in range(1, height):