Commit 56f13725 authored by Sven Neumann's avatar Sven Neumann
Browse files

app/gimage_cmds.c guard against NaN and infinity. There are pics out there

* app/gimage_cmds.c
* tools/pdbgen/pdb/gimage.pdb: (gimp_image_set_resolution) guard
  against NaN and infinity. There are pics out there using these
  values and it seems that NaN > GIMP_MIN_RESOLUTION. Fixes #8476.


--Sven
parent 743516bf
2000-04-06 Sven Neumann <sven@gimp.org>
* app/gimage_cmds.c
* tools/pdbgen/pdb/gimage.pdb: (gimp_image_set_resolution) guard
against NaN and infinity. There are pics out there using these
values and it seems that NaN > GIMP_MIN_RESOLUTION. Fixes #8476.
2000-04-06 Sven Neumann <sven@gimp.org>
 
* app/app_procs.c: if we cannot load the font we'd like to use,
......
......@@ -20,6 +20,9 @@
#include "procedural_db.h"
#include "config.h"
#include <math.h>
#include <string.h>
#include "apptypes.h"
......@@ -32,6 +35,7 @@
#include "layer.h"
#include "layer_pvt.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimplimits.h"
static ProcRecord image_list_proc;
......@@ -3451,9 +3455,15 @@ image_set_resolution_invoker (Argument *args)
if (success)
{
if (xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION ||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
success = FALSE;
if (isnan (xresolution) || xresolution < GIMP_MIN_RESOLUTION ||
isinf (xresolution) || xresolution > GIMP_MAX_RESOLUTION ||
isnan (yresolution) || yresolution < GIMP_MIN_RESOLUTION ||
isinf (yresolution) || yresolution > GIMP_MAX_RESOLUTION)
{
g_message (_("Image resolution is out of bounds,\n"
"using the default resolution instead."));
success = FALSE;
}
else
{
gimage->xresolution = xresolution;
......
2000-04-06 Sven Neumann <sven@gimp.org>
* POTFILES.in: added gimage_cmds.c
* de.po: updated german translation
2000-04-05 Gert Dewit <Gert.Dewit@sos.be>
* nl.po: First 1.1 (and 1.2) Dutch translation effort
......
......@@ -43,6 +43,7 @@ app/fuzzy_select.c
app/gdisplay.c
app/gdisplay_color_ui.c
app/gdisplay_ops.c
app/gimage_cmds.c
app/gimage_mask.c
app/gimpbrush.c
app/gimpbrushlist.c
......
This diff is collapsed.
......@@ -1212,9 +1212,15 @@ HELP
$invoke{code} = <<'CODE';
{
if (xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION ||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
success = FALSE;
if (isnan (xresolution) || xresolution < GIMP_MIN_RESOLUTION ||
isinf (xresolution) || xresolution > GIMP_MAX_RESOLUTION ||
isnan (yresolution) || yresolution < GIMP_MIN_RESOLUTION ||
isinf (yresolution) || yresolution > GIMP_MAX_RESOLUTION)
{
g_message (_("Image resolution is out of bounds,\n"
"using the default resolution instead."));
success = FALSE;
}
else
{
gimage->xresolution = xresolution;
......@@ -1417,7 +1423,8 @@ CODE
}
@headers = qw(<string.h> "gimage.h" "libgimp/gimplimits.h");
@headers = qw("config.h" <string.h> <math.h> "gimage.h"
"libgimp/gimpintl.h" "libgimp/gimplimits.h");
$extra{app}->{code} = <<'CODE';
/* Yuup, this is somewhat unsmooth, to say the least */
......
......@@ -1212,9 +1212,15 @@ HELP
$invoke{code} = <<'CODE';
{
if (xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION ||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
success = FALSE;
if (isnan (xresolution) || xresolution < GIMP_MIN_RESOLUTION ||
isinf (xresolution) || xresolution > GIMP_MAX_RESOLUTION ||
isnan (yresolution) || yresolution < GIMP_MIN_RESOLUTION ||
isinf (yresolution) || yresolution > GIMP_MAX_RESOLUTION)
{
g_message (_("Image resolution is out of bounds,\n"
"using the default resolution instead."));
success = FALSE;
}
else
{
gimage->xresolution = xresolution;
......@@ -1417,7 +1423,8 @@ CODE
}
@headers = qw(<string.h> "gimage.h" "libgimp/gimplimits.h");
@headers = qw("config.h" <string.h> <math.h> "gimage.h"
"libgimp/gimpintl.h" "libgimp/gimplimits.h");
$extra{app}->{code} = <<'CODE';
/* Yuup, this is somewhat unsmooth, to say the least */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment