summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-10-27 12:19:35 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2013-10-27 12:19:35 (GMT)
commit23ec9ceb5bb32a5348f8491243d41a14564c71f5 (patch)
treee23a2beac9f6ac7184903270f00b9fc31a68dd8f
parent797266ea930ca103e7fa7a2e683158d935683f8f (diff)
downloadlibnsfb-23ec9ceb5bb32a5348f8491243d41a14564c71f5.tar.gz
libnsfb-23ec9ceb5bb32a5348f8491243d41a14564c71f5.tar.bz2
Fix buffer length.
-rw-r--r--src/palette.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/palette.c b/src/palette.c
index d600001..1a24127 100644
--- a/src/palette.c
+++ b/src/palette.c
@@ -30,7 +30,7 @@ bool nsfb_palette_new(struct nsfb_palette_s **palette, int width)
(*palette)->last = 0;
(*palette)->dither = false;
- (*palette)->dither_ctx.data_len = width * 3;
+ (*palette)->dither_ctx.data_len = width * 3 * sizeof(int);
(*palette)->dither_ctx.data = malloc(width * 3 * sizeof(int));
if ((*palette)->dither_ctx.data == NULL) {
nsfb_palette_free(*palette);