Mercurial > hg > dmlib
diff src/stb_image.c @ 950:88d9440afad0
Use dmzlib module in stb_image.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 26 Feb 2015 18:35:29 +0200 |
parents | 63fd1801f983 |
children | 1832ac20edb2 |
line wrap: on
line diff
--- a/src/stb_image.c Thu Feb 26 18:28:32 2015 +0200 +++ b/src/stb_image.c Thu Feb 26 18:35:29 2015 +0200 @@ -4263,11 +4263,9 @@ // initial guess for decoded data size to avoid unnecessary reallocs bpl = (s->img_x * depth + 7) / 8; // bytes per line, per component raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */; -#ifdef STBI_INTERNAL_ZLIB + z->expanded = (Uint8 *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone); -#else -# error NOT IMPLEMENTED! -#endif + if (z->expanded == NULL) return 0; // zlib should set error STBI_FREE(z->idata); z->idata = NULL; if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans)