diff options
| author | victorfisac <victorfisac@gmail.com> | 2016-05-20 14:03:23 +0200 |
|---|---|---|
| committer | victorfisac <victorfisac@gmail.com> | 2016-05-20 14:03:23 +0200 |
| commit | 4f1bee31654dec5f5cea2ac9d291d202df504745 (patch) | |
| tree | 42a5028ebab3277a8d46bdcf3fea2990e1aa590d /src/stb_image_write.h | |
| parent | ea7afc8ec835040d84d79ae318f7aebb9f1e189c (diff) | |
| parent | dcf5f45f687f2a534286aecd5e6471a0440b0c21 (diff) | |
| download | raylib-4f1bee31654dec5f5cea2ac9d291d202df504745.tar.gz raylib-4f1bee31654dec5f5cea2ac9d291d202df504745.zip | |
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'src/stb_image_write.h')
| -rw-r--r-- | src/stb_image_write.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/stb_image_write.h b/src/stb_image_write.h index 98fa4103..4319c0de 100644 --- a/src/stb_image_write.h +++ b/src/stb_image_write.h @@ -1,4 +1,4 @@ -/* stb_image_write - v1.01 - public domain - http://nothings.org/stb/stb_image_write.h +/* stb_image_write - v1.02 - public domain - http://nothings.org/stb/stb_image_write.h writes out PNG/BMP/TGA images to C stdio - Sean Barrett 2010-2015 no warranty implied; use at your own risk @@ -102,12 +102,13 @@ CREDITS: Sergio Gonzalez Jonas Karlsson Filip Wasil + Thatcher Ulrich LICENSE -This software is in the public domain. Where that dedication is not -recognized, you are granted a perpetual, irrevocable license to copy, -distribute, and modify this file as you see fit. +This software is dual-licensed to the public domain and under the following +license: you are granted a perpetual, irrevocable license to copy, modify, +publish, and distribute this file as you see fit. */ @@ -736,7 +737,7 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l unsigned int bitbuf=0; int i,j, bitcount=0; unsigned char *out = NULL; - unsigned char **hash_table[stbiw__ZHASH]; // 64KB on the stack! + unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(char**)); if (quality < 5) quality = 5; stbiw__sbpush(out, 0x78); // DEFLATE 32K window @@ -808,6 +809,7 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l for (i=0; i < stbiw__ZHASH; ++i) (void) stbiw__sbfree(hash_table[i]); + STBIW_FREE(hash_table); { // compute adler32 on input @@ -1015,6 +1017,8 @@ STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x, #endif // STB_IMAGE_WRITE_IMPLEMENTATION /* Revision history + 1.02 (2016-04-02) + avoid allocating large structures on the stack 1.01 (2016-01-16) STBIW_REALLOC_SIZED: support allocators with no realloc support avoid race-condition in crc initialization |
