From d2afef58d74aa451b85ec8f8d884b9e2e8d28fa0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 1 Jul 2020 19:23:33 +0200 Subject: [PATCH] (libchdr) Resync against https://github.com/rtissera/libchdr/commit/c05c91300a672b96e077ddde144b3737a01639d8#diff-b4791a43102472fe8d3959f86bd376c4 --- libretro-common/formats/libchdr/libchdr_lzma.c | 2 +- libretro-common/formats/libchdr/libchdr_zlib.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libretro-common/formats/libchdr/libchdr_lzma.c b/libretro-common/formats/libchdr/libchdr_lzma.c index c947b16298..25fabe3cf4 100644 --- a/libretro-common/formats/libchdr/libchdr_lzma.c +++ b/libretro-common/formats/libchdr/libchdr_lzma.c @@ -88,7 +88,7 @@ static void *lzma_fast_alloc(void *p, size_t size) } /* alloc a new one and put it into the list */ - addr = (uint32_t *)malloc(sizeof(uint32_t) * (size + sizeof(uint32_t))); + addr = (uint32_t *)malloc(sizeof(uint32_t) * size + sizeof(uintptr_t)); if (!addr) return NULL; diff --git a/libretro-common/formats/libchdr/libchdr_zlib.c b/libretro-common/formats/libchdr/libchdr_zlib.c index 6e4a5dea7d..7e6fe19ac8 100644 --- a/libretro-common/formats/libchdr/libchdr_zlib.c +++ b/libretro-common/formats/libchdr/libchdr_zlib.c @@ -263,7 +263,7 @@ voidpf zlib_fast_alloc(voidpf opaque, uInt items, uInt size) } /* alloc a new one */ - ptr = (UINT32 *)malloc(size + sizeof(UINT32)); + ptr = (UINT32 *)malloc(size + sizeof(uintptr_t)); if (!ptr) return NULL;