From 03984168c68a4dd09b3accd46d68347e94da69e7 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 13 Mar 2015 19:39:36 +0100 Subject: [PATCH] (RPNG) Create adam7_restore_buf_size --- libretro-common/formats/png/rpng_decode_common.h | 12 ++++++++---- libretro-common/include/formats/rpng.h | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libretro-common/formats/png/rpng_decode_common.h b/libretro-common/formats/png/rpng_decode_common.h index 01fcfcf76b..22913760f8 100644 --- a/libretro-common/formats/png/rpng_decode_common.h +++ b/libretro-common/formats/png/rpng_decode_common.h @@ -457,9 +457,9 @@ static int png_reverse_filter_adam7(uint32_t *data, goto end; } - pngp->inflate_buf += pngp->pass.size; - pngp->restore_buf_size += pngp->pass.size; - pngp->stream.total_out -= pngp->pass.size; + pngp->inflate_buf += pngp->pass.size; + pngp->adam7_restore_buf_size += pngp->pass.size; + pngp->stream.total_out -= pngp->pass.size; png_reverse_filter_adam7_deinterlace_pass(data, ihdr, pngp->data, pngp->pass.width, pngp->pass.height, &passes[pngp->pass.pos]); @@ -476,7 +476,8 @@ cont: return 0; end: - pngp->inflate_buf -= pngp->restore_buf_size; + pngp->inflate_buf -= pngp->adam7_restore_buf_size; + pngp->adam7_restore_buf_size = 0; return ret; } @@ -487,6 +488,9 @@ static bool png_reverse_filter_loop(struct rpng_t *rpng, if (rpng->ihdr.interlace == 1) { int ret = 0; + + rpng->process.adam7_restore_buf_size = 0; + do { ret = png_reverse_filter_adam7(*data, diff --git a/libretro-common/include/formats/rpng.h b/libretro-common/include/formats/rpng.h index 4b1150890e..05418c5fee 100644 --- a/libretro-common/include/formats/rpng.h +++ b/libretro-common/include/formats/rpng.h @@ -71,6 +71,7 @@ struct rpng_process_t uint8_t *decoded_scanline; uint8_t *inflate_buf; size_t restore_buf_size; + size_t adam7_restore_buf_size; size_t inflate_buf_size; unsigned bpp; unsigned pitch;