Fix crash in dynos texture generation

This commit is contained in:
MysterD 2023-11-20 19:47:32 -08:00 committed by Agent X
parent 1e89fcc4d4
commit 9de82b3237

View file

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