fixed range check of blur type parameter (bug #142965).

2004-05-24  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/mblur.c: fixed range check of blur type
	parameter (bug #142965).
This commit is contained in:
Sven Neumann 2004-05-24 13:51:11 +00:00 committed by Sven Neumann
parent 1c860eb121
commit 673939f21b
2 changed files with 13 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2004-05-24 Sven Neumann <sven@gimp.org>
* plug-ins/common/mblur.c: fixed range check of blur type
parameter (bug #142965).
2004-05-24 Sven Neumann <sven@gimp.org>
* plug-ins/maze/maze_face.c: fixed a compiler warning.

View File

@ -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;