diff --git a/src/abr.cpp b/src/abr.cpp index 0095831..e40b006 100644 --- a/src/abr.cpp +++ b/src/abr.cpp @@ -49,10 +49,11 @@ bool ABR::section_samp() auto vm = std::make_shared(); if (vm->read(*this)) { - if (auto img = vm->image(true, true)) + auto img_data = vm->image(true, true); + if (img_data.data) { // TODO: check if uid already exists in map - m_samples[uid] = img; + m_samples[uid] = std::make_shared(img_data); } } } @@ -97,10 +98,11 @@ bool ABR::section_patt() LOG("PATT: image_mode (%d) and number of channels (%ld) not matching\n", image_mode, vm->channels.size()); } - if (auto img = vm->image(true, false)) + auto img_data = vm->image(true, false); + if (img_data.data) { // TODO: check if uid already exists in map - m_patterns[uid] = img; + m_patterns[uid] = std::make_shared(img_data); } } }