summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-03-09 00:58:23 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-03-09 00:58:23 +0000
commit07e1187b69b1b31794e4f2ff2c4a60101c5bf0ad (patch)
tree50997933a39f7e66ef68bb10b63b208c2365deef
parenta074bdbe546b6a64cf4707abcdd3344a5b46b42d (diff)
downloadnetsurf-07e1187b69b1b31794e4f2ff2c4a60101c5bf0ad.tar.gz
netsurf-07e1187b69b1b31794e4f2ff2c4a60101c5bf0ad.tar.bz2
Add .spr -> image/x-riscos-sprite MIME mapping to GTK front end
Fix crash inducing bugs in nssprite.c svn path=/trunk/netsurf/; revision=6743
-rw-r--r--gtk/gtk_filetype.c1
-rw-r--r--image/nssprite.c5
2 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtk_filetype.c b/gtk/gtk_filetype.c
index 1fecbf884..43660055a 100644
--- a/gtk/gtk_filetype.c
+++ b/gtk/gtk_filetype.c
@@ -64,6 +64,7 @@ void gtk_fetch_filetype_init(const char *mimefile)
hash_add(mime_hash, "gif", "image/gif");
hash_add(mime_hash, "png", "image/png");
hash_add(mime_hash, "jng", "image/jng");
+ hash_add(mime_hash, "spr", "image/x-riscos-sprite");
if (fh == NULL) {
LOG(("Unable to open a mime.types file, so using a minimal one for you."));
diff --git a/image/nssprite.c b/image/nssprite.c
index 1603ca74e..494535416 100644
--- a/image/nssprite.c
+++ b/image/nssprite.c
@@ -61,7 +61,7 @@ bool nssprite_convert(struct content *c, int width, int height)
struct rosprite_mem_context* ctx;
ERRCHK(rosprite_create_mem_context((uint8_t *) c->source_data,
- c->total_size, &ctx));
+ c->source_size, &ctx));
struct rosprite_area* sprite_area;
ERRCHK(rosprite_load(rosprite_mem_reader, ctx, &sprite_area));
@@ -118,7 +118,8 @@ bool nssprite_convert(struct content *c, int width, int height)
void nssprite_destroy(struct content *c)
{
- rosprite_destroy_sprite_area(c->data.nssprite.sprite_area);
+ if (c->data.nssprite.sprite_area != NULL)
+ rosprite_destroy_sprite_area(c->data.nssprite.sprite_area);
}