| 4517 | } |
| 4518 | |
| 4519 | STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen) |
| 4520 | { |
| 4521 | stbi__zbuf a; |
| 4522 | char *p = (char *) stbi__malloc(initial_size); |
| 4523 | if (p == NULL) return NULL; |
| 4524 | a.zbuffer = (stbi_uc *) buffer; |
| 4525 | a.zbuffer_end = (stbi_uc *) buffer + len; |
| 4526 | if (stbi__do_zlib(&a, p, initial_size, 1, 1)) { |
| 4527 | if (outlen) *outlen = (int) (a.zout - a.zout_start); |
| 4528 | return a.zout_start; |
| 4529 | } else { |
| 4530 | STBI_FREE(a.zout_start); |
| 4531 | return NULL; |
| 4532 | } |
| 4533 | } |
| 4534 | |
| 4535 | STBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen) |
| 4536 | { |
no test coverage detected