summaryrefslogtreecommitdiff
path: root/src/heightmap.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-02-24 20:59:17 +0000
committersmatz <smatz@openttd.org>2009-02-24 20:59:17 +0000
commitd73c1fa7bfed01a187e14c4d86cde70e7121c51b (patch)
tree50574d6b6befd846433d33e7a7a619e719b57d0a /src/heightmap.cpp
parent8beca127ddf8f97b76c4bd3491ead1f6954b115d (diff)
downloadopenttd-d73c1fa7bfed01a187e14c4d86cde70e7121c51b.tar.xz
(svn r15568) -Cleanup: *allocT/AllocaM doesn't return NULL when allocating fails
Diffstat (limited to 'src/heightmap.cpp')
-rw-r--r--src/heightmap.cpp16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/heightmap.cpp b/src/heightmap.cpp
index 233f5952e..b690438d4 100644
--- a/src/heightmap.cpp
+++ b/src/heightmap.cpp
@@ -137,14 +137,6 @@ static bool ReadHeightmapPNG(char *filename, uint *x, uint *y, byte **map)
if (map != NULL) {
*map = MallocT<byte>(info_ptr->width * info_ptr->height);
-
- if (*map == NULL) {
- ShowErrorMessage(STR_PNGMAP_ERR_MISC, STR_PNGMAP_ERROR, 0, 0);
- fclose(fp);
- png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
- return false;
- }
-
ReadHeightmapPNGImageData(*map, png_ptr, info_ptr);
}
@@ -253,15 +245,7 @@ static bool ReadHeightmapBMP(char *filename, uint *x, uint *y, byte **map)
}
*map = MallocT<byte>(info.width * info.height);
- if (*map == NULL) {
- ShowErrorMessage(STR_PNGMAP_ERR_MISC, STR_BMPMAP_ERROR, 0, 0);
- fclose(f);
- BmpDestroyData(&data);
- return false;
- }
-
ReadHeightmapBMPImageData(*map, &info, &data);
-
}
BmpDestroyData(&data);