diff Core/Images/JpegReader.cpp @ 3378:596cfabd72c5

Fixed a couple of truncation warnings
author Benjamin Golinvaux <bgo@osimis.io>
date Fri, 17 May 2019 08:36:18 +0200
parents 4e43e67f8ecf
children 94f4a18a79cc
line wrap: on
line diff
--- a/Core/Images/JpegReader.cpp	Thu May 16 12:31:47 2019 +0200
+++ b/Core/Images/JpegReader.cpp	Fri May 17 08:36:18 2019 +0200
@@ -161,12 +161,15 @@
     {
       jpeg_destroy_decompress(&cinfo);
       throw OrthancException(ErrorCode_InternalError,
-                             "Error during JPEG decoding: " + jerr.GetMessage());
+        "Error during JPEG decoding: " + jerr.GetMessage());
     }
 
     // Below this line, we are under the scope of a "setjmp"
     jpeg_create_decompress(&cinfo);
-    jpeg_mem_src(&cinfo, const_cast<unsigned char*>(reinterpret_cast<const unsigned char*>(buffer)), size);
+    jpeg_mem_src(&cinfo, 
+      const_cast<unsigned char*>(
+        reinterpret_cast<const unsigned char*>(buffer)),
+      static_cast<unsigned long>(size));
 
     try
     {