aboutsummaryrefslogtreecommitdiff
path: root/graphics/surface.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-04-18 23:34:29 +0200
committerWillem Jan Palenstijn2013-05-08 20:39:44 +0200
commit01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6 (patch)
tree544b07f3aa41abe7907bcd2040cdad11ebc324bb /graphics/surface.cpp
parent9cf2c83e5e5a35816ab153bf8443dac691829ea8 (diff)
parenta41d72a44a660c72fdadbc3a8ef580e5e03cb890 (diff)
downloadscummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.tar.gz
scummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.tar.bz2
scummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.zip
Merge branch 'master'
Diffstat (limited to 'graphics/surface.cpp')
-rw-r--r--graphics/surface.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/graphics/surface.cpp b/graphics/surface.cpp
index 0fad25734c..e0b25f22e9 100644
--- a/graphics/surface.cpp
+++ b/graphics/surface.cpp
@@ -56,8 +56,10 @@ void Surface::create(uint16 width, uint16 height, const PixelFormat &f) {
format = f;
pitch = w * format.bytesPerPixel;
- pixels = calloc(width * height, format.bytesPerPixel);
- assert(pixels);
+ if (width && height) {
+ pixels = calloc(width * height, format.bytesPerPixel);
+ assert(pixels);
+ }
}
void Surface::free() {