diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2014-06-21 15:52:43 -0400 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2014-06-21 15:52:43 -0400 |
commit | 95c83100fe731c652bfc6567d14ce5f415d37ee8 (patch) | |
tree | 8bf0ac7748bdc53629b061d16bfeaa5723b10d02 /src/dicache.c | |
parent | 5a8963b13795402c88451e7167b3335a94643643 (diff) |
Ensure png, jpeg and gif decoders don't use DilloImage after set_parms()
This allows reuse of the dicache entry after repush changes DilloImage.
Diffstat (limited to 'src/dicache.c')
-rw-r--r-- | src/dicache.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dicache.c b/src/dicache.c index 82043590..633d44f9 100644 --- a/src/dicache.c +++ b/src/dicache.c @@ -300,7 +300,7 @@ void a_Dicache_set_parms(DilloUrl *url, int version, DilloImage *Image, /* * Implement the set_cmap method for the Image */ -void a_Dicache_set_cmap(DilloUrl *url, int version, DilloImage *Image, +void a_Dicache_set_cmap(DilloUrl *url, int version, int bg_color, const uchar_t *cmap, uint_t num_colors, int num_colors_max, int bg_index) { @@ -313,9 +313,9 @@ void a_Dicache_set_cmap(DilloUrl *url, int version, DilloImage *Image, DicEntry->cmap = dNew0(uchar_t, 3 * num_colors_max); memcpy(DicEntry->cmap, cmap, 3 * num_colors); if (bg_index >= 0 && (uint_t)bg_index < num_colors) { - DicEntry->cmap[bg_index * 3] = (Image->bg_color >> 16) & 0xff; - DicEntry->cmap[bg_index * 3 + 1] = (Image->bg_color >> 8) & 0xff; - DicEntry->cmap[bg_index * 3 + 2] = (Image->bg_color) & 0xff; + DicEntry->cmap[bg_index * 3] = (bg_color >> 16) & 0xff; + DicEntry->cmap[bg_index * 3 + 1] = (bg_color >> 8) & 0xff; + DicEntry->cmap[bg_index * 3 + 2] = (bg_color) & 0xff; } DicEntry->State = DIC_SetCmap; |