aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-08-06 16:34:18 +0200
committerMattias Andrée <maandree@kth.se>2016-08-06 16:34:18 +0200
commite844e65419ea88e7333ca5acde0d8f728fb2dfeb (patch)
tree03f82a4ee3d714dbe519dfc969a9b83faa97d366
parentFix bugs (diff)
downloadlibcoopgamma-e844e65419ea88e7333ca5acde0d8f728fb2dfeb.tar.gz
libcoopgamma-e844e65419ea88e7333ca5acde0d8f728fb2dfeb.tar.bz2
libcoopgamma-e844e65419ea88e7333ca5acde0d8f728fb2dfeb.tar.xz
Fix bugs
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--src/libcoopgamma.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libcoopgamma.c b/src/libcoopgamma.c
index 269b2c8..52171e4 100644
--- a/src/libcoopgamma.c
+++ b/src/libcoopgamma.c
@@ -1597,7 +1597,7 @@ int libcoopgamma_synchronise(libcoopgamma_context_t* restrict ctx,
p = memchr(line, '\n', ctx->inbound_head - ctx->curline);
if (p == NULL)
break;
- if (memchr(line, '\0', ctx->inbound_head - ctx->curline) != NULL)
+ if (memchr(line, '\0', (size_t)(p - line)) != NULL)
ctx->bad_message = 1;
*p++ = '\0';
ctx->curline = (size_t)(p - ctx->inbound);
@@ -2412,6 +2412,9 @@ int libcoopgamma_get_gamma_recv(libcoopgamma_filter_table_t* restrict table,
off += len;
if (off + clutsize > n)
goto bad;
+ table->filters[i].ramps.u8.red_size = table->red_size;
+ table->filters[i].ramps.u8.green_size = table->green_size;
+ table->filters[i].ramps.u8.blue_size = table->blue_size;
if (libcoopgamma_ramps_initialise_(&(table->filters[i].ramps), width) < 0)
goto fail;
memcpy(table->filters->ramps.u8.red, payload + off, clutsize);