mirror of https://github.com/OpenTTD/OpenTTD
(svn r8044) Regression (r8038): Crash on allocating bridge memory (peter1138)
parent
c5a7eaca65
commit
0cb2bc2b23
|
@ -249,7 +249,7 @@ static bool ReadHeightmapBMP(char *filename, uint *x, uint *y, byte **map)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
MallocT(map, info.width * info.height);
|
MallocT(/* NO & */map, info.width * info.height);
|
||||||
if (*map == NULL) {
|
if (*map == NULL) {
|
||||||
ShowErrorMessage(STR_PNGMAP_ERR_MISC, STR_BMPMAP_ERROR, 0, 0);
|
ShowErrorMessage(STR_PNGMAP_ERR_MISC, STR_BMPMAP_ERROR, 0, 0);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
|
@ -1076,7 +1076,7 @@ static bool BridgeChangeInfo(uint brid, int numinfo, int prop, byte **bufp, int
|
||||||
|
|
||||||
if (bridge->sprite_table == NULL) {
|
if (bridge->sprite_table == NULL) {
|
||||||
/* Allocate memory for sprite table pointers and zero out */
|
/* Allocate memory for sprite table pointers and zero out */
|
||||||
CallocT(bridge->sprite_table, 7);
|
CallocT(&bridge->sprite_table, 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; numtables-- != 0; tableid++) {
|
for (; numtables-- != 0; tableid++) {
|
||||||
|
|
Loading…
Reference in New Issue