diff --git a/app/core/gimpbrush-header.h b/app/core/gimpbrush-header.h index 08f079adf5..bdb6c03fe5 100644 --- a/app/core/gimpbrush-header.h +++ b/app/core/gimpbrush-header.h @@ -28,13 +28,13 @@ typedef struct _BrushHeader BrushHeader; struct _BrushHeader { - guint header_size; /* header_size = sizeof (BrushHeader) + brush name */ - guint version; /* brush file version # */ - guint width; /* width of brush */ - guint height; /* height of brush */ - guint bytes; /* depth of brush in bytes--always 1 */ - guint magic_number; /* GIMP brush magic number */ - guint spacing; /* brush spacing */ + guint32 header_size; /* header_size = sizeof (BrushHeader) + brush name */ + guint32 version; /* brush file version # */ + guint32 width; /* width of brush */ + guint32 height; /* height of brush */ + guint32 bytes; /* depth of brush in bytes--always 1 */ + guint32 magic_number; /* GIMP brush magic number */ + guint32 spacing; /* brush spacing */ }; /* In a brush file, next comes the brush name, null-terminated. After that diff --git a/app/core/gimppattern-header.h b/app/core/gimppattern-header.h index 65da53a9ff..1678443ec1 100644 --- a/app/core/gimppattern-header.h +++ b/app/core/gimppattern-header.h @@ -28,12 +28,12 @@ typedef struct _PatternHeader PatternHeader; struct _PatternHeader { - guint header_size; /* header_size = sizeof(PatternHeader) + pattern name */ - guint version; /* pattern file version # */ - guint width; /* width of pattern */ - guint height; /* height of pattern */ - guint bytes; /* depth of pattern in bytes */ - guint magic_number; /* GIMP pattern magic number */ + guint32 header_size; /* header_size = sizeof(PatternHeader) + pattern name */ + guint32 version; /* pattern file version # */ + guint32 width; /* width of pattern */ + guint32 height; /* height of pattern */ + guint32 bytes; /* depth of pattern in bytes */ + guint32 magic_number; /* GIMP pattern magic number */ }; /* In a pattern file, next comes the pattern name, null-terminated. After that diff --git a/app/core/gimppattern-load.c b/app/core/gimppattern-load.c index 612ff04747..ab41be7938 100644 --- a/app/core/gimppattern-load.c +++ b/app/core/gimppattern-load.c @@ -374,8 +374,7 @@ gimp_pattern_load (const gchar *filename, } /* Check for supported bit depths */ - /* - if (header.bytes != 1 && header.bytes != 3) + if (header.bytes <1 || header.bytes > 3) { g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ, _("Unsupported pattern depth %d\n" @@ -384,7 +383,6 @@ gimp_pattern_load (const gchar *filename, header.bytes, filename); goto error; } - */ /* Read in the pattern name */ if ((bn_size = (header.header_size - sizeof (header)))) diff --git a/app/core/gimppattern.c b/app/core/gimppattern.c index 612ff04747..ab41be7938 100644 --- a/app/core/gimppattern.c +++ b/app/core/gimppattern.c @@ -374,8 +374,7 @@ gimp_pattern_load (const gchar *filename, } /* Check for supported bit depths */ - /* - if (header.bytes != 1 && header.bytes != 3) + if (header.bytes <1 || header.bytes > 3) { g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ, _("Unsupported pattern depth %d\n" @@ -384,7 +383,6 @@ gimp_pattern_load (const gchar *filename, header.bytes, filename); goto error; } - */ /* Read in the pattern name */ if ((bn_size = (header.header_size - sizeof (header)))) diff --git a/configure.in b/configure.in index 80a4422c82..79aebced50 100644 --- a/configure.in +++ b/configure.in @@ -171,6 +171,7 @@ AC_PROG_CPP dnl Large file support for the swap file AC_SYS_LARGEFILE +AC_MSG_CHECKING([whether to turn on debugging]) AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging (default=no)], if eval "test x$enable_debug = xyes"; then @@ -178,7 +179,24 @@ AC_ARG_ENABLE(debug, fi) if test -n "$DEBUGFLAG"; then + AC_MSG_RESULT([yes]) CFLAGS="$DEBUGFLAG $CFLAGS" +else + AC_MSG_RESULT([no]) +fi + +AC_MSG_CHECKING([whether to turn on profiling]) +AC_ARG_ENABLE(profile, + [ --enable-profile turn on profiling (default=no)], + if eval "test x$enable_profile = xyes"; then + PROFFLAG="-pg" + fi) + +if test -n "$PROFFLAG"; then + AC_MSG_RESULT([yes]) + CFLAGS="$PROFFLAG $CFLAGS" +else + AC_MSG_RESULT([no]) fi AC_ARG_ENABLE(ansi,