Random crash in VDSCopy and other apps
I am seeing spurious hangs, segfaults, and OOM kills when decompressing a wavelet compressed VDS file. Seen in my own code but I was able to reproduce it using VDSCopy:
VDSCopy Volve_Seismic_LL_Wavelet.vds /tmp/junk.vds --compression-method None
I am fairly sure I found at least part of the problem. After some work. In VolumeDataStore.cpp function ToDataBlock() the field dataBlock.Components is left un-initialized and will contain a random value. Later this value contributes to the number of bytes to allocate to hold the block. Due to a couple of 32-bit overflows it can even end up as smaller than actually needed - but usually it will be a lot more. The memory allocation is in VolumeDataStore::SerializeVolumeData() in the CompressionMethod::None branch.
I found a similar but unrelated problem in WaveletAdaptiveLLDecompress_CreateDecodeIterator(). If called with transformDataCount = zero or one the secondTransformMask will contain garbage data but will still be used later in the function. My test file has a ridiculous number of LODs (it has all 12) and I assume this is happening when the last few LODs are accessed. I have no idea how to fix it.
Tested on OpenVDS 2.3.0.