Commit ca0b8b04 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

check the return value of fopen() before using it.

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

	* plug-ins/common/CEL.c (need_palette): check the return value of
        fopen() before using it.
parent 66ed5ca9
......@@ -2,6 +2,7 @@
 
* plug-ins/common/CEL.c: fixed coding style issues, removed
trailing whitespace, use gsize instead of size_t.
(need_palette): check the return value of fopen() before using it.
 
2004-01-05 Dov Grobgeld <dov@imagic.weizmann.ac.il>
 
......@@ -229,13 +229,17 @@ run (const gchar *name,
static gboolean
need_palette (const gchar *file)
{
FILE *fp = fopen (file, "rb");
guchar header[32];
FILE *fp
guchar header[32];
fp = fopen (file, "rb");
if (!fp)
return FALSE;
fread (header, 32, 1, fp);
fclose (fp);
return header[5] < 32;
return (header[5] < 32);
}
/* Load CEL image into The GIMP */
......
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