[gdk-pixbuf/wip/otte/tga: 20/24] tga: Only check for as many pixels as are actually needed
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf/wip/otte/tga: 20/24] tga: Only check for as many pixels as are actually needed
- Date: Wed, 30 Sep 2015 01:30:52 +0000 (UTC)
commit e93cd6e1369f5fc90e38903c1858ef905264137b
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 21 23:34:28 2015 +0200
tga: Only check for as many pixels as are actually needed
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 b915d98..7500359 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 {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]