diff OrthancServer/FromDcmtkBridge.cpp @ 1981:4b545a8b1f95

return code in Toolbox::DecodeDataUriScheme
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 22 Apr 2016 09:05:06 +0200
parents 325772dadcd6
children 9b61701c35f2
line wrap: on
line diff
--- a/OrthancServer/FromDcmtkBridge.cpp	Fri Apr 22 08:57:33 2016 +0200
+++ b/OrthancServer/FromDcmtkBridge.cpp	Fri Apr 22 09:05:06 2016 +0200
@@ -1264,7 +1264,11 @@
         boost::starts_with(utf8Value, "data:application/octet-stream;base64,"))
     {
       std::string mime;
-      Toolbox::DecodeDataUriScheme(mime, binary, utf8Value);
+      if (!Toolbox::DecodeDataUriScheme(mime, binary, utf8Value))
+      {
+        throw OrthancException(ErrorCode_BadFileFormat);
+      }
+
       decoded = &binary;
     }
     else if (dicomEncoding != Encoding_Utf8)