Fix crash in dynos texture generation

This commit is contained in:
MysterD 2023-11-20 19:47:32 -08:00
parent b0094f7ce4
commit 7450b84694
1 changed files with 2 additions and 0 deletions

View File

@ -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<u8>(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<u8>(aLength * 4);
u8 *pBuffer = _Buffer;
for (u64 i = 0; i != aLength; ++i) {