From 10d55bbb06129a3f627c8cf58a81a4841b3a9a41 Mon Sep 17 00:00:00 2001 From: Pascal Massimino Date: Thu, 28 Apr 2011 15:52:44 -0700 Subject: [PATCH] move chunk[] declaration out of the for() loop Change-Id: I10df4b5d6d186bae2b9b1a174aab13c401c54b01 --- src/enc/alpha.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/enc/alpha.c b/src/enc/alpha.c index cdacb6c8..a3f269d2 100644 --- a/src/enc/alpha.c +++ b/src/enc/alpha.c @@ -28,6 +28,8 @@ static int CompressAlpha(const uint8_t* data, size_t data_size, int ret = Z_OK; z_stream strm; const int CHUNK_SIZE = 8192; + unsigned char chunk[CHUNK_SIZE]; + *output = NULL; *output_size = 0; memset(&strm, 0, sizeof(strm)); @@ -38,7 +40,7 @@ static int CompressAlpha(const uint8_t* data, size_t data_size, strm.avail_in = data_size; do { size_t size_out; - unsigned char chunk[CHUNK_SIZE]; + strm.next_out = chunk; strm.avail_out = CHUNK_SIZE; ret = deflate(&strm, Z_FINISH);