plug-ins/bmp/bmp.h (Bitmap_Head_Struct) use a signed long for width and

2005-03-24  Sven Neumann  <sven@gimp.org>

	* plug-ins/bmp/bmp.h (Bitmap_Head_Struct)
	* plug-ins/bmp/bmpread.c: use a signed long for width and height
	and check that width is > 0 (negative height is allowed and
	handled by our code). Fixes bug #171453.
This commit is contained in:
Sven Neumann 2005-03-24 20:56:39 +00:00 committed by Sven Neumann
parent bd9ef9bed6
commit 2617fe3fe4
3 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2005-03-24 Sven Neumann <sven@gimp.org>
* plug-ins/bmp/bmp.h (Bitmap_Head_Struct)
* plug-ins/bmp/bmpread.c: use a signed long for width and height
and check that width is > 0 (negative height is allowed and
handled by our code). Fixes bug #171453.
2005-03-24 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/core/gimpimage-undo-push.[ch]

View File

@ -45,7 +45,7 @@ extern struct Bitmap_File_Head_Struct
extern struct Bitmap_Head_Struct
{
gulong biWidth; /* 12 */
glong biWidth; /* 12 */
glong biHeight; /* 16 */
gushort biPlanes; /* 1A */
gushort biBitCnt; /* 1C */

View File

@ -300,6 +300,13 @@ ReadBMP (const gchar *name)
return -1;
}
if (Bitmap_Head.biWidth < 0)
{
g_message (_("'%s' is not a valid BMP file"),
gimp_filename_to_utf8 (filename));
return -1;
}
if (Bitmap_Head.biPlanes != 1) {
g_message (_("Error reading BMP file header from '%s'"),
gimp_filename_to_utf8 (filename));