summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2014-03-09 20:30:00 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2014-03-09 20:30:00 +0100
commit57ea9ae04aa3deab8e12a53fddc51baec1edb372 (patch)
treeb8308004963fa0baa56e037034c85a58a0153f70
parent8e1b3aa798b635c75fa63ca95c1e266d4494d48e (diff)
don't crash if screen dump fails
-rw-r--r--src/ScreenDump.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ScreenDump.cxx b/src/ScreenDump.cxx
index c0f038e..f331a76 100644
--- a/src/ScreenDump.cxx
+++ b/src/ScreenDump.cxx
@@ -42,6 +42,9 @@ ScreenDump::~ScreenDump() {
int
ScreenDump::save(OutputImage *out) {
+ if (!rgb)
+ return 1;
+
out->init(w, h);
for (int y = 0; y < h; y++) {