if (!ctx->cmap->cols) {
g_set_error(err, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
_("Can't allocate colormap entries"));
- g_free(ctx->cmap);
return FALSE;
}
g_set_error(err, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("Unexpected bitdepth for colormap entries"));
- g_free(ctx->cmap->cols);
- g_free(ctx->cmap);
return FALSE;
}
}
TGAContext *ctx = (TGAContext *) data;
g_return_val_if_fail(ctx != NULL, FALSE);
- g_free(ctx->hdr);
- if (ctx->cmap)
- g_free(ctx->cmap);
+ if (ctx->hdr)
+ g_free (ctx->hdr);
+ if (ctx->cmap) {
+ if (ctx->cmap->cols)
+ g_free (ctx->cmap->cols);
+ g_free (ctx->cmap);
+ }
if (ctx->pbuf)
- g_object_unref(ctx->pbuf);
+ g_object_unref (ctx->pbuf);
if (ctx->in->size)
- ctx->in = io_buffer_free_segment(ctx->in, ctx->in->size, err);
+ ctx->in = io_buffer_free_segment (ctx->in, ctx->in->size, err);
if (!ctx->in) {
- g_free(ctx);
+ g_free (ctx);
return FALSE;
}
- io_buffer_free(ctx->in);
- g_free(ctx);
+ io_buffer_free (ctx->in);
+ g_free (ctx);
return TRUE;
}
return NULL;
}
- if (!TIFFReadRGBAImage (tiff, w, h, rast, 0) || global_error) {
+ if (!TIFFReadRGBAImage (tiff, w, h, rast, 1) || global_error) {
tiff_set_error (error,
GDK_PIXBUF_ERROR_FAILED,
_("Failed to load RGB data from TIFF file"));