CID 715700, 715701: Fixed assumption of 4 byte pointer size.
This commit is contained in:
parent
6314232f45
commit
f3780ae8b2
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user