From 7450b84694344a9ae00f8003be6f104d9eed0798 Mon Sep 17 00:00:00 2001 From: MysterD Date: Mon, 20 Nov 2023 19:47:32 -0800 Subject: [PATCH] Fix crash in dynos texture generation --- data/dynos_mgr_tex.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/dynos_mgr_tex.cpp b/data/dynos_mgr_tex.cpp index f7a197a6..13582bf3 100644 --- a/data/dynos_mgr_tex.cpp +++ b/data/dynos_mgr_tex.cpp @@ -110,6 +110,7 @@ static u8 *IA16_RGBA32(const u8 *aData, u64 aLength) { } static u8 *CI4_RGBA32(const u8 *aData, u64 aLength, const u8 *aPalette) { + if (!aPalette) { return NULL; } u8 *_Buffer = New(aLength * 8); u8 *pBuffer = _Buffer; for (u64 i = 0; i != aLength; ++i) { @@ -139,6 +140,7 @@ static u8 *CI4_RGBA32(const u8 *aData, u64 aLength, const u8 *aPalette) { } static u8 *CI8_RGBA32(const u8 *aData, u64 aLength, const u8 *aPalette) { + if (!aPalette) { return NULL; } u8 *_Buffer = New(aLength * 4); u8 *pBuffer = _Buffer; for (u64 i = 0; i != aLength; ++i) {