From 2e53655b27310a8938152bd3d731795d016ce803 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 26 Sep 2013 10:09:42 +0800 Subject: [PATCH] fix #208 --- AUTHORS | 2 +- src/BackgroundRenderer/SplashBackgroundRenderer.cc | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index f8b295e..de4c045 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,4 +17,4 @@ Arthur Titeica Deepak Thukral Jamie Ly Lu Wang - +Steven Lee diff --git a/src/BackgroundRenderer/SplashBackgroundRenderer.cc b/src/BackgroundRenderer/SplashBackgroundRenderer.cc index 6e3ff95..dfe248d 100644 --- a/src/BackgroundRenderer/SplashBackgroundRenderer.cc +++ b/src/BackgroundRenderer/SplashBackgroundRenderer.cc @@ -188,10 +188,16 @@ void SplashBackgroundRenderer::dump_image(const char * filename, int x1, int y1, p += row_size; } - if(!writer->writePointers(pointers.data(), height)) { + if(!writer->writePointers(pointers.data(), height)) + { throw "Cannot write background image"; } + if(!writer->close()) + { + throw "Cannot finish background image"; + } + fclose(f); }