CID 715700, 715701: Fixed assumption of 4 byte pointer size.

This commit is contained in:
Alex Smith 2012-08-18 12:24:09 +01:00
parent 6314232f45
commit f3780ae8b2
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ SFHash::SFHash(int size) {
fatalerror = false;
this->size = size;
iterate_pos = iterate_depth = 0;
main_array = (HashItem **)malloc(this->size * 4);
main_array = (HashItem **)malloc(this->size * sizeof(HashItem *));
if (main_array == NULL) {
fatalerror = true;

View File

@ -324,7 +324,7 @@ SavePalette::SavePalette(BBitmap *bitmap, int32 maxSizeInBits)
fSizeInBits++;
fSize = 1 << fSizeInBits;
ColorItem **topcolors = (ColorItem **)malloc(fSize * 4);
ColorItem **topcolors = (ColorItem **)malloc(fSize * sizeof(ColorItem *));
if (topcolors == NULL) {
if (debug) printf("Out of memory in SavePalette(BBitmap *)\n");
fFatalError = true;