#include <errno.h>
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-io.h"
-
+#include <glib/gstdio.h>
\f
/* I have must have done something to deserve this.
return NULL;
}
items = sscanf (buffer, "%d %d %d %d %d %d", &w, &h, &n_col, &cpp, &x_hot, &y_hot);
+
+ if (items != 4 && items != 6) {
+ g_set_error (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("Invalid XPM header"));
+ return NULL;
+ }
+
if (w <= 0) {
g_set_error (error,
GDK_PIXBUF_ERROR,
}
fclose (context->file);
- unlink (context->tempname);
+ g_unlink (context->tempname);
g_free (context->tempname);
g_free ((XPMContext *) context);