aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Marshall <jmarshall@never.you.mind>2013-01-06 15:24:04 +1300
committerS. Davilla <davilla@4pi.com>2013-01-06 08:36:07 -0500
commite10e60eb807164863458571627805c0c5db76281 (patch)
tree4bffc4239b61773674474f7ee7f8c076d01587d4
parent76243b8b59806a43df7d1715af48aab54479a4f8 (diff)
pass the correct output buffer size to lzo1x_compress rather than the input buffer size
-rw-r--r--tools/TexturePacker/XBMCTex.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/TexturePacker/XBMCTex.cpp b/tools/TexturePacker/XBMCTex.cpp
index 8db78eb873..488e909008 100644
--- a/tools/TexturePacker/XBMCTex.cpp
+++ b/tools/TexturePacker/XBMCTex.cpp
@@ -196,7 +196,8 @@ CXBTFFrame appendContent(CXBTFWriter &writer, int width, int height, unsigned ch
if ((flags & FLAGS_USE_LZO) == FLAGS_USE_LZO)
{
// grab a temporary buffer for unpacking into
- unsigned char *packed = new unsigned char[size + size / 16 + 64 + 3]; // see simple.c in lzo
+ packedSize = size + size / 16 + 64 + 3; // see simple.c in lzo
+ unsigned char *packed = new unsigned char[packedSize];
unsigned char *working = new unsigned char[LZO1X_999_MEM_COMPRESS];
if (packed && working)
{