diff options
author | Dave Higton <dave@davehigton.me.uk> | 2015-10-31 15:49:34 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-10-31 15:49:34 +0000 |
commit | f2e56834be6ee3ac5246cbe6a835793d60fbe6d3 (patch) | |
tree | b951d117202ddedfd5e43207dc15f54a1409b3e6 /riscos/bitmap.c | |
parent | b1533a7f768c58dbc3f62246b64ce1329f53269c (diff) | |
download | netsurf-f2e56834be6ee3ac5246cbe6a835793d60fbe6d3.tar.gz netsurf-f2e56834be6ee3ac5246cbe6a835793d60fbe6d3.tar.bz2 |
When an image content cannot be converted prevent export as sprite
If an image is not converted, for example it is a CMYK jpeg this
prevents a crash if trying to export the image as a RISC OS sprite.
Diffstat (limited to 'riscos/bitmap.c')
-rw-r--r-- | riscos/bitmap.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/riscos/bitmap.c b/riscos/bitmap.c index 384895d32..162a8c6f6 100644 --- a/riscos/bitmap.c +++ b/riscos/bitmap.c @@ -43,6 +43,7 @@ #include "utils/filename.h" #include "utils/log.h" #include "utils/utils.h" +#include "utils/messages.h" #include "desktop/plotters.h" #include "content/content.h" #include "image/bitmap.h" @@ -272,6 +273,11 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags) struct bitmap *bitmap = (struct bitmap *) vbitmap; os_error *error; + if (bitmap == NULL) { + warn_user("SaveError", messages_get("SprIsNull")); + return false; + } + if (!bitmap->sprite_area) { riscos_bitmap_get_buffer(bitmap); } |