diff options
author | Mattias Andrée <maandree@kth.se> | 2016-08-06 18:47:36 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2016-08-06 18:47:36 +0200 |
commit | 520cadc8f6bcda01014eb896b62f8ae0ea6f7129 (patch) | |
tree | f63e6021a6ff62d256363dfd2690039739da2d34 /src/libcoopgamma.c | |
parent | Fix error recv bug (diff) | |
download | libcoopgamma-520cadc8f6bcda01014eb896b62f8ae0ea6f7129.tar.gz libcoopgamma-520cadc8f6bcda01014eb896b62f8ae0ea6f7129.tar.bz2 libcoopgamma-520cadc8f6bcda01014eb896b62f8ae0ea6f7129.tar.xz |
Fix filter removal bug
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | src/libcoopgamma.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/libcoopgamma.c b/src/libcoopgamma.c index 2ca0a32..14d085c 100644 --- a/src/libcoopgamma.c +++ b/src/libcoopgamma.c @@ -2510,22 +2510,22 @@ int libcoopgamma_set_gamma_send(const libcoopgamma_filter_t* restrict filter, goto fail; } - switch (filter->depth) + if (filter->lifespan != LIBCOOPGAMMA_REMOVE) { - case LIBCOOPGAMMA_FLOAT: stopwidth = sizeof(float); break; - case LIBCOOPGAMMA_DOUBLE: stopwidth = sizeof(double); break; - default: INTEGRAL_DEPTHS - if ((filter->depth <= 0) || ((filter->depth & 7) != 0)) + switch (filter->depth) { - errno = EINVAL; - goto fail; + case LIBCOOPGAMMA_FLOAT: stopwidth = sizeof(float); break; + case LIBCOOPGAMMA_DOUBLE: stopwidth = sizeof(double); break; + default: INTEGRAL_DEPTHS + if ((filter->depth <= 0) || ((filter->depth & 7) != 0)) + { + errno = EINVAL; + goto fail; + } + stopwidth = (size_t)(filter->depth / 8); + break; } - stopwidth = (size_t)(filter->depth / 8); - break; - } - - if (filter->lifespan != LIBCOOPGAMMA_REMOVE) - { + payload_size = filter->ramps.u8.red_size; payload_size += filter->ramps.u8.green_size; payload_size += filter->ramps.u8.blue_size; |