MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / stbi_zlib_decode_malloc_guesssize

Function stbi_zlib_decode_malloc_guesssize

Source/Utils/stb_image.h:4519–4533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4517}
4518
4519STBIDEF 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
4535STBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen)
4536{

Callers 1

stbi_zlib_decode_mallocFunction · 0.85

Calls 2

stbi__mallocFunction · 0.85
stbi__do_zlibFunction · 0.85

Tested by

no test coverage detected