changeset 1123:c023fae92620

Oops, 100L in dmzlib context init in image loader .. fixed.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 04 Mar 2015 04:42:38 +0200
parents 320dcfd1bd75
children b8bfd9fbe1d9
files src/stb_image.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/stb_image.c	Wed Mar 04 04:38:39 2015 +0200
+++ b/src/stb_image.c	Wed Mar 04 04:42:38 2015 +0200
@@ -3706,6 +3706,10 @@
     DMZLibContext ctx;
     int ret;
 
+
+    if ((ret = dmZLibInitInflate(&ctx)) != DMERR_OK)
+        goto err;
+
     if ((ctx.outBuffer = ctx.outBufferStart = dmMalloc(initialSize)) == NULL)
     {
         ret = dmError(DMERR_MALLOC,
@@ -3714,9 +3718,6 @@
     }
 
     // Initialize decompression structures
-    if ((ret = dmZLibInitInflate(&ctx)) != DMERR_OK)
-        goto err;
-
     ctx.inBuffer      = ctx.inBufferStart = inBuf;
     ctx.inBufferEnd   = inBuf + inLen;
     ctx.outBufferEnd  = ctx.outBufferStart + initialSize;