Mercurial > hg > orthanc
changeset 2082:d2a0c41869ab
fix for sandboxed environments
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 08 Sep 2016 16:27:22 +0200 |
parents | 681e9ea81581 |
children | bfeacb51af20 |
files | Core/Images/IImageWriter.h |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/Core/Images/IImageWriter.h Wed Sep 07 09:07:10 2016 +0200 +++ b/Core/Images/IImageWriter.h Thu Sep 08 16:27:22 2016 +0200 @@ -56,9 +56,13 @@ PixelFormat format, const void* buffer) { - std::string compressed; +#if !defined(ORTHANC_SANDBOXED) || ORTHANC_SANDBOXED != 1 + std::string compressed; WriteToMemoryInternal(compressed, width, height, pitch, format, buffer); Toolbox::WriteFile(compressed, path); +#else + throw OrthancException(ErrorCode_CannotWriteFile); // Unavailable in sandboxed environments +#endif } public: