Hm.
Could be that I'm not locking properly when I retrieve the channel index from the map as the map may get a channel inserted into it before the retrieved value is used. Thought locking on map insert would be enough but I guess not...
Try changing this method in DDImageAdapter.cpp, 158, it's likely more reliable:
Dcx::ChannelIdx
dcxChannel (DD::Image::Channel z)
{
context_lock.lock();
std::map<DD::Image::Channel, Dcx::ChannelIdx>::const_iterator it = dcx_channel_map.find(z);
if (it != dcx_channel_map.end())
{
const Dcx::ChannelIdx dcx_chan = it->second;
context_lock.unlock();
return dcx_chan;
}
context_lock.unlock();
return dcxAddChannel(z); // not found, add it now