From 92c813ec69a0c013e0da3691538d957a6610117b Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 13 Oct 2008 01:18:56 +0000 Subject: [PATCH] libpipi: get rid of all remaining large stack allocations. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2942 92316355-f0b4-4df1-b90c-862c8a59935f --- pipi/codec/oric.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pipi/codec/oric.c b/pipi/codec/oric.c index d31d6ca..ba790c3 100644 --- a/pipi/codec/oric.c +++ b/pipi/codec/oric.c @@ -524,15 +524,16 @@ static uint8_t bestmove(int const *in, uint8_t bg, uint8_t fg, static void write_screen(float const *data, uint8_t *screen) { - int src[(WIDTH + 1) * (HEIGHT + 1) * 3]; - int dst[(WIDTH + 1) * (HEIGHT + 1) * 3]; - int *srcl, *dstl; + int *src, *srcl, *dst, *dstl; int stride, x, y, depth, c; stride = (WIDTH + 1) * 3; - memset(src, 0, sizeof(src)); - memset(dst, 0, sizeof(dst)); + src = malloc((WIDTH + 1) * (HEIGHT + 1) * 3); + memset(src, 0, (WIDTH + 1) * (HEIGHT + 1) * 3); + + dst = malloc((WIDTH + 1) * (HEIGHT + 1) * 3); + memset(dst, 0, (WIDTH + 1) * (HEIGHT + 1) * 3); /* Import pixels into our custom format */ for(y = 0; y < HEIGHT; y++)