diff options
author | Mattias Andrée <maandree@kth.se> | 2016-08-06 17:18:26 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-08-06 17:18:26 +0200 |
commit | c5f88e207ea0187378fb53748612e792ac11ad80 (patch) | |
tree | 1254f8693fad94525ce885ea4d83954ee34db65e /src/libcoopgamma.c | |
parent | Fix bugs (diff) | |
download | libcoopgamma-c5f88e207ea0187378fb53748612e792ac11ad80.tar.gz libcoopgamma-c5f88e207ea0187378fb53748612e792ac11ad80.tar.bz2 libcoopgamma-c5f88e207ea0187378fb53748612e792ac11ad80.tar.xz |
Fix get-gamma bugs
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/libcoopgamma.c')
-rw-r--r-- | src/libcoopgamma.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; |