From 673939f21bfe918b735b4e9a9886bb523e903ed7 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Mon, 24 May 2004 13:51:11 +0000 Subject: [PATCH] fixed range check of blur type parameter (bug #142965). 2004-05-24 Sven Neumann * plug-ins/common/mblur.c: fixed range check of blur type parameter (bug #142965). --- ChangeLog | 5 +++++ plug-ins/common/mblur.c | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 75b78d8411..43dc56709c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-05-24 Sven Neumann + + * plug-ins/common/mblur.c: fixed range check of blur type + parameter (bug #142965). + 2004-05-24 Sven Neumann * plug-ins/maze/maze_face.c: fixed a compiler warning. diff --git a/plug-ins/common/mblur.c b/plug-ins/common/mblur.c index 9dc2417063..a415190454 100644 --- a/plug-ins/common/mblur.c +++ b/plug-ins/common/mblur.c @@ -65,11 +65,14 @@ #define PLUG_IN_VERSION "Sep 1997, 1.2" #define HELP_ID "plug-in-mblur" -#define MBLUR_LINEAR 0 -#define MBLUR_RADIAL 1 -#define MBLUR_ZOOM 2 +typedef enum +{ + MBLUR_LINEAR, + MBLUR_RADIAL, + MBLUR_ZOOM, + MBLUR_MAX = MBLUR_ZOOM +} MBlurType; -#define MBLUR_MAX MBLUR_ZOOM typedef struct { @@ -221,7 +224,7 @@ run (const gchar *name, mbvals.angle = param[5].data.d_int32; } - if ((mbvals.mblur_type < 0) && (mbvals.mblur_type > MBLUR_ZOOM)) + if ((mbvals.mblur_type < 0) || (mbvals.mblur_type > MBLUR_MAX)) status= GIMP_PDB_CALLING_ERROR; break;