summaryrefslogtreecommitdiff
path: root/src/screenshot.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/screenshot.cpp
parent8beca127ddf8f97b76c4bd3491ead1f6954b115d (diff)
downloadopenttd-d73c1fa7bfed01a187e14c4d86cde70e7121c51b.tar.xz
(svn r15568) -Cleanup: *allocT/AllocaM doesn't return NULL when allocating fails
Diffstat (limited to 'src/screenshot.cpp')
-rw-r--r--src/screenshot.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/screenshot.cpp b/src/screenshot.cpp
index 8b0aa4530..960c08416 100644
--- a/src/screenshot.cpp
+++ b/src/screenshot.cpp
@@ -127,10 +127,6 @@ static bool MakeBmpImage(const char *name, ScreenshotCallback *callb, void *user
/* now generate the bitmap bits */
void *buff = MallocT<uint8>(padw * maxlines * bpp); // by default generate 128 lines at a time.
- if (buff == NULL) {
- fclose(f);
- return false;
- }
memset(buff, 0, padw * maxlines); // zero the buffer to have the padding bytes set to 0
/* start at the bottom, since bitmaps are stored bottom up. */
@@ -255,11 +251,6 @@ static bool MakePNGImage(const char *name, ScreenshotCallback *callb, void *user
/* now generate the bitmap bits */
void *buff = MallocT<uint8>(w * maxlines * bpp); // by default generate 128 lines at a time.
- if (buff == NULL) {
- png_destroy_write_struct(&png_ptr, &info_ptr);
- fclose(f);
- return false;
- }
memset(buff, 0, w * maxlines * bpp);
y = 0;
@@ -355,10 +346,6 @@ static bool MakePCXImage(const char *name, ScreenshotCallback *callb, void *user
/* now generate the bitmap bits */
uint8 *buff = MallocT<uint8>(w * maxlines); // by default generate 128 lines at a time.
- if (buff == NULL) {
- fclose(f);
- return false;
- }
memset(buff, 0, w * maxlines); // zero the buffer to have the padding bytes set to 0
y = 0;