initialize buffer with memset

This commit is contained in:
jinjunzh 2023-06-16 14:37:01 -04:00
parent 3617316026
commit 5f8ef27513

View File

@ -382,6 +382,9 @@ UInt32 CompressionCodecDeflateQpl::getMaxCompressedDataSize(UInt32 uncompressed_
UInt32 CompressionCodecDeflateQpl::doCompressData(const char * source, UInt32 source_size, char * dest) const
{
#if defined(MEMORY_SANITIZER)
memset(dest, 0 , getMaxCompressedDataSize(source_size));
#endif
Int32 res = HardwareCodecDeflateQpl::RET_ERROR;
if (DeflateQplJobHWPool::instance().isJobPoolReady())
res = hw_codec->doCompressData(source, source_size, dest, getMaxCompressedDataSize(source_size));
@ -392,6 +395,9 @@ UInt32 CompressionCodecDeflateQpl::doCompressData(const char * source, UInt32 so
void CompressionCodecDeflateQpl::doDecompressData(const char * source, UInt32 source_size, char * dest, UInt32 uncompressed_size) const
{
#if defined(MEMORY_SANITIZER)
memset(dest, 0 , uncompressed_size);
#endif
switch (getDecompressMode())
{
case CodecMode::Synchronous: