fixed ubsan invalid vptr error with dynamic_array<hash_pair> in struct work_item (nw)

This commit is contained in:
Oliver Stöneberg 2014-02-26 00:43:11 +00:00
parent 4f4d91429d
commit e86e124aa7
2 changed files with 11 additions and 1 deletions

View File

@ -2316,7 +2316,6 @@ chd_file_compressor::chd_file_compressor()
m_write_hunk(0)
{
// zap arrays
memset(m_work_item, 0, sizeof(m_work_item));
memset(m_codecs, 0, sizeof(m_codecs));
// allocate work queues

View File

@ -516,6 +516,17 @@ private:
// a single work item
struct work_item
{
work_item()
: m_osd(NULL)
, m_compressor(NULL)
, m_status(WS_READY)
, m_data(NULL)
, m_compressed(NULL)
, m_complen(0)
, m_compression(0)
, m_codecs(NULL)
{ }
osd_work_item * m_osd; // OSD work item running on this block
chd_file_compressor *m_compressor; // pointer back to the compressor
volatile work_status m_status; // current status of this item