From f8a05caf8850d719e90b9eb9ce6c319ed33ecd15 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sun, 4 Aug 2019 12:04:02 +0200 Subject: [PATCH] Changed variable declaration to avoid hiding previous local declaration. --- MagickCore/matrix.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/MagickCore/matrix.c b/MagickCore/matrix.c index 2e595b3c4..0d59accee 100644 --- a/MagickCore/matrix.c +++ b/MagickCore/matrix.c @@ -878,8 +878,7 @@ MagickExport Image *MatrixToImage(const MatrixInfo *matrix_info, double max_value, min_value, - scale_factor, - value; + scale_factor; Image *image; @@ -899,9 +898,8 @@ MagickExport Image *MatrixToImage(const MatrixInfo *matrix_info, /* Determine range of matrix. */ - (void) GetMatrixElement(matrix_info,0,0,&value); - min_value=value; - max_value=value; + (void) GetMatrixElement(matrix_info,0,0,&min_value); + max_value=min_value; for (y=0; y < (ssize_t) matrix_info->rows; y++) { register ssize_t @@ -909,6 +907,9 @@ MagickExport Image *MatrixToImage(const MatrixInfo *matrix_info, for (x=0; x < (ssize_t) matrix_info->columns; x++) { + double + value; + if (GetMatrixElement(matrix_info,x,y,&value) == MagickFalse) continue; if (value < min_value) -- 2.40.0