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
This commit is contained in:
John Mark Bell 2009-03-09 00:58:23 +00:00
parent a074bdbe54
commit 07e1187b69
2 changed files with 4 additions and 2 deletions

View File

@ -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."));

View File

@ -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);
}