Fixed bug: out of bound access.

This commit is contained in:
johns 2000-06-08 07:32:57 +00:00
parent cd6118a95a
commit e0d9e224ec

View file

@ -1272,12 +1272,15 @@ global void MapColorCycle(void)
}
#endif
//
// Convert 16 bit pixel table into two 32 bit tables.
//
for( i=0; i<256; ++i ) {
PixelsLow[i]=((VMemType16*)TheMap.TileData->Pixels)[i]&0xFFFF;
PixelsHigh[i]=(((VMemType16*)TheMap.TileData->Pixels)[i]&0xFFFF)<<16;
if( VideoDepth==15 || VideoDepth==16 ) {
//
// Convert 16 bit pixel table into two 32 bit tables.
//
for( i=0; i<256; ++i ) {
PixelsLow[i]=((VMemType16*)TheMap.TileData->Pixels)[i]&0xFFFF;
PixelsHigh[i]=(((VMemType16*)TheMap.TileData->Pixels)[i]&0xFFFF)
<<16;
}
}
}