MCPcopy Create free account
hub / github.com/TheRealMJP/DXRPathTracer / tdefl_output_buffer_putter

Function tdefl_output_buffer_putter

SampleFramework12/v1.02/TinyEXR.cpp:3918–3939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3916} tdefl_output_buffer;
3917
3918static mz_bool tdefl_output_buffer_putter(const void *pBuf, int len,
3919 void *pUser) {
3920 tdefl_output_buffer *p = (tdefl_output_buffer *)pUser;
3921 size_t new_size = p->m_size + len;
3922 if (new_size > p->m_capacity) {
3923 size_t new_capacity = p->m_capacity;
3924 mz_uint8 *pNew_buf;
3925 if (!p->m_expandable)
3926 return MZ_FALSE;
3927 do {
3928 new_capacity = MZ_MAX(128U, new_capacity << 1U);
3929 } while (new_size > new_capacity);
3930 pNew_buf = (mz_uint8 *)MZ_REALLOC(p->m_pBuf, new_capacity);
3931 if (!pNew_buf)
3932 return MZ_FALSE;
3933 p->m_pBuf = pNew_buf;
3934 p->m_capacity = new_capacity;
3935 }
3936 memcpy((mz_uint8 *)p->m_pBuf + p->m_size, pBuf, len);
3937 p->m_size = new_size;
3938 return MZ_TRUE;
3939}
3940
3941void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len,
3942 size_t *pOut_len, int flags) {

Calls

no outgoing calls

Tested by

no test coverage detected