diff --git a/libretro-common/formats/png/rpng.c b/libretro-common/formats/png/rpng.c index 9cf7af0fc7..4edd616acb 100644 --- a/libretro-common/formats/png/rpng.c +++ b/libretro-common/formats/png/rpng.c @@ -674,7 +674,7 @@ bool rpng_load_image_argb_iterate(FILE *file, struct png_chunk *chunk, if (fread(&palette, 3, entries, file) != entries) return false; - if (!png_read_plte_into_buf(palette, chunk->size / 3)) + if (!png_read_plte_into_buf(palette, entries)) return false; *increment_size = sizeof(uint32_t);