changeset 3352:def55522f357

merge
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 23 Apr 2019 10:33:19 +0200
parents 5069af20932a (diff) ba051f674f4b (current diff)
children e60e194531e5
files
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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];