summaryrefslogtreecommitdiff
path: root/src/dicache.c
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2014-06-21 15:52:43 -0400
committerJorge Arellano Cid <jcid@dillo.org>2014-06-21 15:52:43 -0400
commita53102d108d53fec583d73f3d4349b78a48a714d (patch)
treec7e4799466793b8e4f9525a15d6c8da6556fb926 /src/dicache.c
parent2cc782748bbe4f84d248decf7e85bcfce31b0cdd (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.c8
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;