From 2b834ce9d85c67c97eed3b2cc23d5262b2db1e38 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 16 Oct 2016 01:34:16 +0200 Subject: [PATCH] (rpng) Prevent implicit memsets --- libretro-common/formats/png/rpng.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/libretro-common/formats/png/rpng.c b/libretro-common/formats/png/rpng.c index 8844b44918..e1204414f0 100644 --- a/libretro-common/formats/png/rpng.c +++ b/libretro-common/formats/png/rpng.c @@ -918,7 +918,9 @@ error: static bool read_chunk_header(uint8_t *buf, struct png_chunk *chunk) { unsigned i; - uint8_t dword[4] = {0}; + uint8_t dword[4]; + + dword[0] = '\0'; for (i = 0; i < 4; i++) dword[i] = buf[i]; @@ -953,9 +955,13 @@ static bool png_parse_ihdr(uint8_t *buf, bool rpng_iterate_image(rpng_t *rpng) { unsigned i; - struct png_chunk chunk = {0}; + struct png_chunk chunk; uint8_t *buf = (uint8_t*)rpng->buff_data; + chunk.size = 0; + chunk.type[0] = 0; + chunk.data = NULL; + if (!read_chunk_header(buf, &chunk)) return false; @@ -1135,10 +1141,12 @@ void rpng_free(rpng_t *rpng) bool rpng_start(rpng_t *rpng) { unsigned i; - char header[8] = {0}; + char header[8]; if (!rpng) return false; + + header[0] = '\0'; for (i = 0; i < 8; i++) header[i] = rpng->buff_data[i];