summaryrefslogtreecommitdiff
path: root/riscos/bitmap.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2008-06-14 23:13:19 +0000
committerJames Bursa <james@netsurf-browser.org>2008-06-14 23:13:19 +0000
commit337a2004cca31d55e16d8316e32d55ae4316472f (patch)
tree394f1ef48401f17e7019b45baba117d90df4093b /riscos/bitmap.c
parent43fe5333408bb2e7c7be1c12f95020809ef21d97 (diff)
downloadnetsurf-337a2004cca31d55e16d8316e32d55ae4316472f.tar.gz
netsurf-337a2004cca31d55e16d8316e32d55ae4316472f.tar.bz2
Don't crash when attempting to save a bitmap with no data. This can happen when out of memory.
svn path=/trunk/netsurf/; revision=4332
Diffstat (limited to 'riscos/bitmap.c')
-rw-r--r--riscos/bitmap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/riscos/bitmap.c b/riscos/bitmap.c
index edfa90c2c..4d8423cdb 100644
--- a/riscos/bitmap.c
+++ b/riscos/bitmap.c
@@ -1057,7 +1057,12 @@ void bitmap_save_file(struct bitmap *bitmap)
os_error *error;
struct bitmap_compressed_header *header;
- assert(bitmap && (bitmap->compressed || bitmap->sprite_area));
+ assert(bitmap);
+
+ if (!bitmap->compressed && !bitmap->sprite_area) {
+ LOG(("bitmap has no data"));
+ return;
+ }
/* unmodified bitmaps will still have their file available */
if ((!(bitmap->state & BITMAP_MODIFIED)) && bitmap->filename[0]) {