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

Function stbi_zlib_decode_noheader_malloc

Source/Utils/stb_image.h:4567–4581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4565}
4566
4567STBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen)
4568{
4569 stbi__zbuf a;
4570 char *p = (char *) stbi__malloc(16384);
4571 if (p == NULL) return NULL;
4572 a.zbuffer = (stbi_uc *) buffer;
4573 a.zbuffer_end = (stbi_uc *) buffer+len;
4574 if (stbi__do_zlib(&a, p, 16384, 1, 0)) {
4575 if (outlen) *outlen = (int) (a.zout - a.zout_start);
4576 return a.zout_start;
4577 } else {
4578 STBI_FREE(a.zout_start);
4579 return NULL;
4580 }
4581}
4582
4583STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen)
4584{

Callers

nothing calls this directly

Calls 2

stbi__mallocFunction · 0.85
stbi__do_zlibFunction · 0.85

Tested by

no test coverage detected