[gimp] PCX: Stop parsing an invalid file early on.
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] PCX: Stop parsing an invalid file early on.
- Date: Sat, 8 Apr 2017 10:11:16 +0000 (UTC)
commit 20c9b60487f1f6f1562856a328ad39097fa90647
Author: Tobias Stoeckmann <tobias stoeckmann org>
Date: Thu Apr 6 21:42:44 2017 +0200
PCX: Stop parsing an invalid file early on.
If either width or height is 0, gimp won't process the PCX file.
Instead, a bunch of error messages are printed.
It's nicer to quit parsing the file early on with a good error message
which is straight to the point instead.
Signed-off-by: Tobias Stoeckmann <tobias stoeckmann org>
plug-ins/common/file-pcx.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/common/file-pcx.c b/plug-ins/common/file-pcx.c
index ede642b..fcda727 100644
--- a/plug-ins/common/file-pcx.c
+++ b/plug-ins/common/file-pcx.c
@@ -397,13 +397,13 @@ load_image (const gchar *filename,
resolution_x = GUINT16_FROM_LE (pcx_header.hdpi);
resolution_y = GUINT16_FROM_LE (pcx_header.vdpi);
- if ((width < 0) || (width > GIMP_MAX_IMAGE_SIZE))
+ if ((width <= 0) || (width > GIMP_MAX_IMAGE_SIZE))
{
g_message (_("Unsupported or invalid image width: %d"), width);
fclose (fd);
return -1;
}
- if ((height < 0) || (height > GIMP_MAX_IMAGE_SIZE))
+ if ((height <= 0) || (height > GIMP_MAX_IMAGE_SIZE))
{
g_message (_("Unsupported or invalid image height: %d"), height);
fclose (fd);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]