From 9de82b323736711bce2839d24535ff140e673f90 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 6568b34f..d36da4f3 100644 --- a/data/dynos_mgr_tex.cpp +++ b/data/dynos_mgr_tex.cpp @@ -115,6 +115,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) { @@ -144,6 +145,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) {