diff
  typedef struct _wStream {
+     size_t size; // Field to track the size of the buffer
      // ... other fields ...
  } wStream;

  int zgfx_decompress(ZGFX_CONTEXT* zgfx, const BYTE* pSrcData, UINT32 SrcSize, BYTE** ppDstData,
  wStream sbuffer = { 0 };
+ sbuffer.size = sizeof(sbuffer); // Set the size of the buffer
