From e844e65419ea88e7333ca5acde0d8f728fb2dfeb Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 6 Aug 2016 16:34:18 +0200 Subject: Fix 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libcoopgamma.c') 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); -- cgit v1.2.3-70-g09d2