aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2013-11-27 19:44:54 +0100
committerJohannes Schickel2013-11-27 19:44:54 +0100
commit14d328facab9867f61e9b7c3e26eb62d7ccdb2e3 (patch)
treea50418884d266336968036841ea4ed3d9f31b5fe
parent10def6a4353a081871065ed5622023e6f4f865bb (diff)
downloadscummvm-rg350-14d328facab9867f61e9b7c3e26eb62d7ccdb2e3.tar.gz
scummvm-rg350-14d328facab9867f61e9b7c3e26eb62d7ccdb2e3.tar.bz2
scummvm-rg350-14d328facab9867f61e9b7c3e26eb62d7ccdb2e3.zip
GRAPHICS: Fix SharedPtrSurfaceDeleter for nullptr inputs.
-rw-r--r--graphics/surface.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/graphics/surface.h b/graphics/surface.h
index 07e289b0bb..f1b2aa64ab 100644
--- a/graphics/surface.h
+++ b/graphics/surface.h
@@ -334,7 +334,9 @@ public:
*/
struct SharedPtrSurfaceDeleter {
void operator()(Surface *ptr) {
- ptr->free();
+ if (ptr) {
+ ptr->free();
+ }
delete ptr;
}
};