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;
|
fatalerror = false;
|
||||||
this->size = size;
|
this->size = size;
|
||||||
iterate_pos = iterate_depth = 0;
|
iterate_pos = iterate_depth = 0;
|
||||||
main_array = (HashItem **)malloc(this->size * 4);
|
main_array = (HashItem **)malloc(this->size * sizeof(HashItem *));
|
||||||
|
|
||||||
if (main_array == NULL) {
|
if (main_array == NULL) {
|
||||||
fatalerror = true;
|
fatalerror = true;
|
||||||
|
@ -324,7 +324,7 @@ SavePalette::SavePalette(BBitmap *bitmap, int32 maxSizeInBits)
|
|||||||
fSizeInBits++;
|
fSizeInBits++;
|
||||||
fSize = 1 << fSizeInBits;
|
fSize = 1 << fSizeInBits;
|
||||||
|
|
||||||
ColorItem **topcolors = (ColorItem **)malloc(fSize * 4);
|
ColorItem **topcolors = (ColorItem **)malloc(fSize * sizeof(ColorItem *));
|
||||||
if (topcolors == NULL) {
|
if (topcolors == NULL) {
|
||||||
if (debug) printf("Out of memory in SavePalette(BBitmap *)\n");
|
if (debug) printf("Out of memory in SavePalette(BBitmap *)\n");
|
||||||
fFatalError = true;
|
fFatalError = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user