From 2bf751a48a132fc779e555b4976529d0fe7e5d73 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Wed, 3 May 2023 19:41:53 +0200 Subject: [PATCH] Revert "compress/gz: Add hack to allow macOS compressed GZs to load with stbi" This reverts commit 1dd75a18aca6fe69e0b9df88d92ee99d1388eb48. --- common/compress/gzip.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/common/compress/gzip.c b/common/compress/gzip.c index 93703611..76fc90f4 100644 --- a/common/compress/gzip.c +++ b/common/compress/gzip.c @@ -116,15 +116,7 @@ void *gzip_uncompress(const void *source, uint64_t sourceLen, uint64_t *outsize) void *buf = ext_mem_alloc(dlen); - // XXX for some reason certain GZ files made by macOS do not properly decompress with stb_image - // unless some skew (19 bytes?) is applied to the buffer. I have no idea why this is the - // case but I'd rather have them load somewhat than not load at all. - for (uint64_t skew = 0; skew < 32; skew++) { - res = stbi_zlib_decode_noheader_buffer(buf, dlen, (const char *)start + skew, (src + sourceLen) - start - 8 - skew); - if (res != -1) { - break; - } - } + res = stbi_zlib_decode_noheader_buffer(buf, dlen, (const char *)start, (src + sourceLen) - start - 8); if (res == -1) { pmm_free(buf, dlen);