From c5f88e207ea0187378fb53748612e792ac11ad80 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 6 Aug 2016 17:18:26 +0200 Subject: Fix get-gamma bugs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libcoopgamma.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libcoopgamma.c b/src/libcoopgamma.c index 52171e4..387e698 100644 --- a/src/libcoopgamma.c +++ b/src/libcoopgamma.c @@ -2358,7 +2358,8 @@ int libcoopgamma_get_gamma_recv(libcoopgamma_filter_table_t* restrict table, if (bad || (have_depth != 1) || (have_red_size != 1) || (have_green_size != 1) || (have_blue_size != 1) || (async->coalesce ? (have_tables > 1) : (have_tables == 0)) || (((payload == NULL) || (n == 0)) && (async->coalesce || (table->filter_count > 0))) || - ((n > 0) && (table->filter_count == 0))) + ((n > 0) && have_tables && (table->filter_count == 0)) || + (async->coalesce && have_tables && (table->filter_count != 1))) goto bad; switch (table->depth) @@ -2384,9 +2385,13 @@ int libcoopgamma_get_gamma_recv(libcoopgamma_filter_table_t* restrict table, goto fail; table->filters->priority = 0; table->filters->class = NULL; + table->filters->ramps.u8.red_size = table->red_size; + table->filters->ramps.u8.green_size = table->green_size; + table->filters->ramps.u8.blue_size = table->blue_size; if (libcoopgamma_ramps_initialise_(&(table->filters->ramps), width) < 0) goto fail; memcpy(table->filters->ramps.u8.red, payload, clutsize); + table->filter_count = 1; } else if (table->filter_count == 0) table->filters = NULL; -- cgit v1.2.3-70-g09d2