From 018fd91230eef39c4793a4c7b4adbabe810d5c32 Mon Sep 17 00:00:00 2001 From: Giovanni Bajo Date: Sat, 12 Aug 2023 01:30:51 +0200 Subject: [PATCH] asset: add EOM asserts --- src/asset.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/asset.c b/src/asset.c index 64b23b639f..17e1aa9280 100644 --- a/src/asset.c +++ b/src/asset.c @@ -71,6 +71,7 @@ void *asset_load(const char *fn, int *sz) case 2: { size = header.orig_size; s = memalign(16, size); + assertf(s, "asset_load: out of memory"); int n = decompress_lz5h_full(f, s, size); (void)n; assertf(n == size, "asset: decompression error on file %s: corrupted? (%d/%d)", fn, n, size); } break; @@ -88,6 +89,7 @@ void *asset_load(const char *fn, int *sz) } s = memalign(16, bufsize); + assertf(s, "asset_load: out of memory"); int n; #ifdef N64