From 752f5dc42b28c29a518b57889cb4c7416cc58a15 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 13 Mar 2015 23:54:17 +0100 Subject: [PATCH] (RPNG) Add data_restore_buf_size --- libretro-common/formats/png/rpng_decode_common.h | 5 ++++- libretro-common/include/formats/rpng.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libretro-common/formats/png/rpng_decode_common.h b/libretro-common/formats/png/rpng_decode_common.h index e93ccce665..ab0a16c16f 100644 --- a/libretro-common/formats/png/rpng_decode_common.h +++ b/libretro-common/formats/png/rpng_decode_common.h @@ -299,7 +299,8 @@ static int png_reverse_filter_init(const struct png_ihdr *ihdr, if (pngp->stream.total_out < pass_size) return -1; - pngp->restore_buf_size = 0; + pngp->restore_buf_size = 0; + pngp->data_restore_buf_size = 0; pngp->prev_scanline = (uint8_t*)calloc(1, pngp->pitch); pngp->decoded_scanline = (uint8_t*)calloc(1, pngp->pitch); @@ -443,11 +444,13 @@ static int png_reverse_filter_regular_loop(uint32_t **data_, const struct png_ih break; case PNG_PROCESS_NEXT: data += ihdr->width; + pngp->data_restore_buf_size += ihdr->width; } }while(ret == PNG_PROCESS_NEXT); pngp->inflate_buf -= pngp->restore_buf_size; + pngp->data_restore_buf_size = 0; return ret; } diff --git a/libretro-common/include/formats/rpng.h b/libretro-common/include/formats/rpng.h index 940fef84e3..ce88178344 100644 --- a/libretro-common/include/formats/rpng.h +++ b/libretro-common/include/formats/rpng.h @@ -73,6 +73,7 @@ struct rpng_process_t uint8_t *inflate_buf; size_t restore_buf_size; size_t adam7_restore_buf_size; + size_t data_restore_buf_size; size_t inflate_buf_size; unsigned bpp; unsigned pitch;