diff options
author | Benjamin Otte <otte@redhat.com> | 2015-09-21 17:51:19 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2015-09-24 12:48:53 +0200 |
commit | b12f599d048c6b04bc5e61f41c2ca93e22385ea2 (patch) | |
tree | 29860ddb5064fd120fdde88407adddc8d760dbe2 | |
parent | d3212ed070fb6ee9e99db11381854a9d1b2e2507 (diff) | |
download | gdk-pixbuf-b12f599d048c6b04bc5e61f41c2ca93e22385ea2.tar.gz |
tga: Use new tga_pixels_remaining() in rle loader
-rw-r--r-- | 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 8e950d504..0f2c10f1e 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)) |