- fix a bug in the png renderer of the software renderer with decals: if the palette remap is missing, don't attempt to use it. (fix null pointer)

This commit is contained in:
Rachael Alexanderson 2020-08-25 19:10:02 -04:00
parent dfd5726eb0
commit 28f7728980

View file

@ -360,7 +360,8 @@ void FPNGTexture::ReadAlphaRemap(FileReader *lump, uint8_t *alpharemap)
uint8_t r = lump->ReadUInt8(); uint8_t r = lump->ReadUInt8();
uint8_t g = lump->ReadUInt8(); uint8_t g = lump->ReadUInt8();
uint8_t b = lump->ReadUInt8(); uint8_t b = lump->ReadUInt8();
alpharemap[i] = PaletteMap[i] == 0 ? 0 : Luminance(r, g, b); int ti = PaletteMap ? PaletteMap[i] : i;
alpharemap[i] = ti == 0 ? 0 : Luminance(r, g, b);
} }
lump->Seek(p, FileReader::SeekSet); lump->Seek(p, FileReader::SeekSet);
} }