diff options
author | Benjamin Otte <otte@redhat.com> | 2015-09-21 22:26:52 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-10-13 02:56:47 +0200 |
commit | 6286d5289c772dc8549beb9138fc3cbc5212939c (patch) | |
tree | 8396a71a38e6a052f4df201c546dc62052eb3620 /gdk-pixbuf/io-tga.c | |
parent | f9728455ca45fe6fde092c3554d47a8a3d74741c (diff) | |
download | gdk-pixbuf-6286d5289c772dc8549beb9138fc3cbc5212939c.tar.gz |
tga: Error out if a pseudocolor image comes without colormap
Diffstat (limited to 'gdk-pixbuf/io-tga.c')
-rw-r--r-- | gdk-pixbuf/io-tga.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gdk-pixbuf/io-tga.c b/gdk-pixbuf/io-tga.c index 0f2c10f1e..848b76e6e 100644 --- a/gdk-pixbuf/io-tga.c +++ b/gdk-pixbuf/io-tga.c @@ -512,6 +512,17 @@ tga_load_colormap (TGAContext *ctx, g_bytes_unref (bytes); } + else + { + if ((ctx->hdr->type == TGA_TYPE_PSEUDOCOLOR) + || (ctx->hdr->type == TGA_TYPE_RLE_PSEUDOCOLOR)) + { + g_set_error_literal (err, GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_CORRUPT_IMAGE, + _("Pseudocolor image does not contain a colormap")); + return FALSE; + } + } if ((ctx->hdr->type == TGA_TYPE_RLE_PSEUDOCOLOR) || (ctx->hdr->type == TGA_TYPE_RLE_TRUECOLOR) |