From a63c525fb7af896e10edb3c59826d705f650ac73 Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 13 Oct 2008 02:06:21 +0000 Subject: [PATCH] libpipi: fix a buffer underallocation. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2943 92316355-f0b4-4df1-b90c-862c8a59935f --- pipi/codec/oric.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pipi/codec/oric.c b/pipi/codec/oric.c index ba790c3..e6df6c4 100644 --- a/pipi/codec/oric.c +++ b/pipi/codec/oric.c @@ -529,11 +529,11 @@ static void write_screen(float const *data, uint8_t *screen) stride = (WIDTH + 1) * 3; - src = malloc((WIDTH + 1) * (HEIGHT + 1) * 3); - memset(src, 0, (WIDTH + 1) * (HEIGHT + 1) * 3); + src = malloc((WIDTH + 1) * (HEIGHT + 1) * 3 * sizeof(int)); + memset(src, 0, (WIDTH + 1) * (HEIGHT + 1) * 3 * sizeof(int)); - dst = malloc((WIDTH + 1) * (HEIGHT + 1) * 3); - memset(dst, 0, (WIDTH + 1) * (HEIGHT + 1) * 3); + dst = malloc((WIDTH + 1) * (HEIGHT + 1) * 3 * sizeof(int)); + memset(dst, 0, (WIDTH + 1) * (HEIGHT + 1) * 3 * sizeof(int)); /* Import pixels into our custom format */ for(y = 0; y < HEIGHT; y++)