summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-tga.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdk-pixbuf/io-tga.c')
-rw-r--r--gdk-pixbuf/io-tga.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdk-pixbuf/io-tga.c b/gdk-pixbuf/io-tga.c
index 1f797a3b3e..fb1aa75617 100644
--- a/gdk-pixbuf/io-tga.c
+++ b/gdk-pixbuf/io-tga.c
@@ -633,6 +633,20 @@ static gboolean try_preload(TGAContext *ctx, GError **err)
_("TGA image type not supported"));
return FALSE;
}
+ switch (ctx->hdr->type) {
+ case TGA_TYPE_PSEUDOCOLOR:
+ case TGA_TYPE_TRUECOLOR:
+ case TGA_TYPE_GRAYSCALE:
+ case TGA_TYPE_RLE_PSEUDOCOLOR:
+ case TGA_TYPE_RLE_TRUECOLOR:
+ case TGA_TYPE_RLE_GRAYSCALE:
+ break;
+ default:
+ g_set_error(err, GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
+ _("TGA image type not supported"));
+ return FALSE;
+ }
if (!fill_in_context(ctx, err))
return FALSE;
} else {