From 6ed08213b510be004b2cbcd4ee6cc83a00def303 Mon Sep 17 00:00:00 2001 From: "Kwabena W. Agyeman" Date: Mon, 29 Feb 2016 21:31:20 -0500 Subject: [PATCH] Fix unintialized error. If the rect was not intersecting these functions would have returned bad values. --- src/omv/py/py_image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/omv/py/py_image.c b/src/omv/py/py_image.c index d1d4b814f..d0e0abb66 100644 --- a/src/omv/py/py_image.c +++ b/src/omv/py/py_image.c @@ -537,7 +537,7 @@ static mp_obj_t py_image_centroid(uint n_args, const mp_obj_t *args, mp_map_t *k rectangle_t arg_r; py_helper_lookup_rectangle(kw_args, arg_img, &arg_r); - int x, y; + int x = 0, y = 0; int sum = imlib_centroid(arg_img, &x, &y, &arg_r); return mp_obj_new_tuple(3, (mp_obj_t[3]) @@ -552,7 +552,7 @@ static mp_obj_t py_image_orientation_radians(uint n_args, const mp_obj_t *args, rectangle_t arg_r; py_helper_lookup_rectangle(kw_args, arg_img, &arg_r); - int sum, x, y; + int sum = 0, x = 0, y = 0; float o = imlib_orientation_radians(arg_img, &sum, &x, &y, &arg_r); return mp_obj_new_tuple(4, (mp_obj_t[4]) @@ -567,7 +567,7 @@ static mp_obj_t py_image_orientation_degrees(uint n_args, const mp_obj_t *args, rectangle_t arg_r; py_helper_lookup_rectangle(kw_args, arg_img, &arg_r); - int sum, x, y; + int sum = 0, x = 0, y = 0; float o = imlib_orientation_degrees(arg_img, &sum, &x, &y, &arg_r); return mp_obj_new_tuple(4, (mp_obj_t[4])