diff --git a/Makefile.common b/Makefile.common index ca606b8edf..b70dd2187e 100644 --- a/Makefile.common +++ b/Makefile.common @@ -570,7 +570,7 @@ endif ifeq ($(HAVE_ZLIB), 1) ZLIB_OBJS = decompress/zip_support.o - OBJ += libretro-common/formats/png/rpng.o file_extract.o + OBJ += libretro-common/formats/png/rpng_nbio.o file_extract.o OBJ += $(ZLIB_OBJS) DEFINES += -DHAVE_ZLIB HAVE_COMPRESSION = 1 diff --git a/libretro-common/formats/png/rpng_nbio.c b/libretro-common/formats/png/rpng_nbio.c index f028908b7e..459cff5a9a 100644 --- a/libretro-common/formats/png/rpng_nbio.c +++ b/libretro-common/formats/png/rpng_nbio.c @@ -660,6 +660,8 @@ bool rpng_load_image_argb_iterate(uint8_t *buf, if (entries > 256) return false; + buf += 8; + for (i = 0; i < entries; i++) palette[i] = buf[i];