diff options
author | Benjamin Otte <otte@redhat.com> | 2015-09-21 23:34:28 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-10-13 02:56:47 +0200 |
commit | 118bdf49b7c9c4239f9a6cb3bbeb40fccdbaaf33 (patch) | |
tree | 890bac2fd76621cdb1e1fb37bb96b31a8ab2654c | |
parent | 6f71effa78e8366caedc28962d1d74661a90df03 (diff) | |
download | gdk-pixbuf-118bdf49b7c9c4239f9a6cb3bbeb40fccdbaaf33.tar.gz |
tga: Only check for as many pixels as are actually needed
-rw-r--r-- | gdk-pixbuf/io-tga.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdk-pixbuf/io-tga.c b/gdk-pixbuf/io-tga.c index b915d98ab..7500359f6 100644 --- a/gdk-pixbuf/io-tga.c +++ b/gdk-pixbuf/io-tga.c @@ -415,7 +415,7 @@ tga_load_rle_image (TGAContext *ctx, tag = *s; s++, n++; if (tag & 0x80) { - if (n + bytes_per_pixel >= size) { + if (n + bytes_per_pixel > size) { --n; break; } else { @@ -433,7 +433,7 @@ tga_load_rle_image (TGAContext *ctx, } } else { raw_num = tag + 1; - if (n + (raw_num * bytes_per_pixel) >= size) { + if (n + (raw_num * bytes_per_pixel) > size) { --n; break; } else { |