# HG changeset patch # User Sebastien Jodogne # Date 1556008399 -7200 # Node ID def55522f3578332c73baa1199d3d77bf8030ec9 # Parent 5069af20932adea7e2f761ca287b3881ba287493# Parent ba051f674f4bf20d45cea7693df9d27754cdb4d8 merge diff -r ba051f674f4b -r def55522f357 Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp --- a/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp Tue Apr 23 08:48:49 2019 +0200 +++ b/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp Tue Apr 23 10:33:19 2019 +0200 @@ -371,7 +371,10 @@ if (decoded.empty()) { decoded.resize(pimpl_->GetImage().GetBufferLength()); - pimpl_->GetImage().GetBuffer(&decoded[0]); + if (!pimpl_->GetImage().GetBuffer(&decoded[0])) + { + throw std::runtime_error("Image not properly decoded to a memory buffer"); + } } const void* sourceBuffer = &decoded[0];