diff --git a/libretro-common/formats/png/rpng_decode_common.h b/libretro-common/formats/png/rpng_decode_common.h index 61f7772d5f..818d14cf10 100644 --- a/libretro-common/formats/png/rpng_decode_common.h +++ b/libretro-common/formats/png/rpng_decode_common.h @@ -108,6 +108,8 @@ static bool png_reverse_filter(uint32_t *data, const struct png_ihdr *ihdr, if (!pngp->prev_scanline || !pngp->decoded_scanline) GOTO_END_ERROR(); + pngp->h = 0; + for (; pngp->h < ihdr->height; pngp->h++, inflate_buf += pngp->pitch, data += ihdr->width) {