diff --git a/src/modules/Image/colortable.c b/src/modules/Image/colortable.c index 2d583cb3ec7cdc57d6be4e90317ba0c9dc6f1846..5a5fa075009c17b0284bfc5c4aba771e0729a88f 100644 --- a/src/modules/Image/colortable.c +++ b/src/modules/Image/colortable.c @@ -1,12 +1,12 @@ #include "global.h" #include <config.h> -/* $Id: colortable.c,v 1.49 1999/02/22 01:24:13 mirar Exp $ */ +/* $Id: colortable.c,v 1.50 1999/03/19 11:11:36 hubbe Exp $ */ /* **! module Image **! note -**! $Id: colortable.c,v 1.49 1999/02/22 01:24:13 mirar Exp $ +**! $Id: colortable.c,v 1.50 1999/03/19 11:11:36 hubbe Exp $ **! class colortable **! **! This object keeps colortable information, @@ -21,7 +21,7 @@ #undef COLORTABLE_DEBUG #undef COLORTABLE_REDUCE_DEBUG -RCSID("$Id: colortable.c,v 1.49 1999/02/22 01:24:13 mirar Exp $"); +RCSID("$Id: colortable.c,v 1.50 1999/03/19 11:11:36 hubbe Exp $"); #include <math.h> /* fabs() */ @@ -101,6 +101,20 @@ static void colortable_free_lookup_stuff(struct neo_colortable *nct) } } +static void colortable_free_dither_union(struct neo_colortable *nct) +{ + switch (nct->dither_type) + { + case NCTD_ORDERED: + free(nct->du.ordered.rdiff); + free(nct->du.ordered.gdiff); + free(nct->du.ordered.bdiff); + break; + default: + ; + } +} + static void free_colortable_struct(struct neo_colortable *nct) { struct nct_scale *s; @@ -122,6 +136,8 @@ static void free_colortable_struct(struct neo_colortable *nct) nct->type=NCT_NONE; return; /* done */ } + + colortable_free_dither_union(nct); } static void colortable_init_stuff(struct neo_colortable *nct) @@ -3810,6 +3826,7 @@ void image_colortable_ordered(INT32 args) int r,g,b; int xsize,ysize; + colortable_free_dither_union(THIS); THIS->dither_type=NCTD_NONE; if (args>=3)