# HG changeset patch # User Matti Hamalainen # Date 1425178001 -7200 # Node ID b1d22289af24ade4ae6cfad842d022211eb44409 # Parent 5101766dd95c0f144395a6dce3af5de59b50e3ca Comments. diff -r 5101766dd95c -r b1d22289af24 src/dmres.c --- a/src/dmres.c Sun Mar 01 04:46:23 2015 +0200 +++ b/src/dmres.c Sun Mar 01 04:46:41 2015 +0200 @@ -395,12 +395,14 @@ Uint8 *inBuf = NULL; int ret; + // Allocate buuffer for compressed data if ((inBuf = dmMalloc(node->length)) == NULL) { ret = DMERR_MALLOC; goto out; } + // Read compressed data if (fread(inBuf, sizeof(Uint8), node->length, handle->lib->packFile->file) != node->length) { ret = DMERR_FREAD; @@ -414,6 +416,7 @@ goto out; } + // Initialize decompression structures ctx.zbuffer = inBuf; ctx.zbufferEnd = inBuf + node->length; ctx.zoutEnd = ctx.zoutStart + node->size;