[gdk-pixbuf] tga: Use new tga_pixels_remaining() in rle loader
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] tga: Use new tga_pixels_remaining() in rle loader
- Date: Tue, 13 Oct 2015 01:01:03 +0000 (UTC)
commit f9728455ca45fe6fde092c3554d47a8a3d74741c
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 21 17:51:19 2015 +0200
tga: Use new tga_pixels_remaining() in rle loader
gdk-pixbuf/io-tga.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/gdk-pixbuf/io-tga.c b/gdk-pixbuf/io-tga.c
index 8e950d5..0f2c10f 100644
--- a/gdk-pixbuf/io-tga.c
+++ b/gdk-pixbuf/io-tga.c
@@ -423,11 +423,10 @@ tga_load_rle_image (TGAContext *ctx,
tga_read_pixel (ctx, s, &color);
s += bytes_per_pixel;
n += bytes_per_pixel;
+ rle_num = MIN (rle_num, tga_pixels_remaining (ctx));
for (; rle_num; rle_num--)
{
tga_write_pixel (ctx, &color);
- if (tga_all_pixels_written (ctx))
- break;
}
if (tga_all_pixels_written (ctx))
break;
@@ -438,13 +437,12 @@ tga_load_rle_image (TGAContext *ctx,
--n;
break;
} else {
+ raw_num = MIN (raw_num, tga_pixels_remaining (ctx));
for (; raw_num; raw_num--) {
tga_read_pixel (ctx, s, &color);
s += bytes_per_pixel;
n += bytes_per_pixel;
tga_write_pixel (ctx, &color);
- if (tga_all_pixels_written (ctx))
- break;
}
if (tga_all_pixels_written (ctx))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]