[gdk-pixbuf] tga: Don't care about extra data at end of file
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] tga: Don't care about extra data at end of file
- Date: Tue, 13 Oct 2015 00:59:52 +0000 (UTC)
commit 438014a00cf3598469b997272976ca3609638a6f
Author: Benjamin Otte <otte redhat com>
Date: Sun Sep 20 07:55:39 2015 +0200
tga: Don't care about extra data at end of file
It's called the "extension area" and people are free to put random stuff
there. So don't error out if they do.
gdk-pixbuf/io-tga.c | 10 +---------
1 files changed, 1 insertions(+), 9 deletions(-)
---
diff --git a/gdk-pixbuf/io-tga.c b/gdk-pixbuf/io-tga.c
index df80864..3596737 100644
--- a/gdk-pixbuf/io-tga.c
+++ b/gdk-pixbuf/io-tga.c
@@ -112,7 +112,6 @@ struct _TGAColormap {
struct _TGAContext {
TGAHeader *hdr;
guint rowstride;
- guint completed_lines;
gboolean run_length_encoded;
TGAColormap *cmap;
@@ -303,7 +302,6 @@ static gboolean fill_in_context(TGAContext *ctx, GError **err)
else if (ctx->hdr->type == TGA_TYPE_TRUECOLOR)
ctx->rowstride = ctx->pbuf->rowstride;
- ctx->completed_lines = 0;
return TRUE;
}
@@ -881,14 +879,8 @@ static gboolean gdk_pixbuf__tga_load_increment(gpointer data,
if (ctx->run_length_encoded) {
parse_rle_data (ctx);
} else {
- while (gdk_pixbuf_buffer_queue_get_size (ctx->input) >= ctx->rowstride) {
- if (ctx->completed_lines >= ctx->pbuf->height) {
- g_set_error_literal(err, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_FAILED,
- _("Excess data in file"));
- return FALSE;
- }
+ while (!ctx->done && gdk_pixbuf_buffer_queue_get_size (ctx->input) >= ctx->rowstride) {
parse_data_for_row (ctx);
- ctx->completed_lines++;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]