From 25626e14045731020aa6c09a982957226a80a87b Mon Sep 17 00:00:00 2001
From: Otmane Lahlou <otmane.lahlou@c-s.fr>
Date: Mon, 22 Nov 2010 14:20:43 +0100
Subject: [PATCH] ENH: add comment to explain the cast

---
 Code/IO/otbGDALImageIO.cxx | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Code/IO/otbGDALImageIO.cxx b/Code/IO/otbGDALImageIO.cxx
index e1931aada0..b42f310005 100644
--- a/Code/IO/otbGDALImageIO.cxx
+++ b/Code/IO/otbGDALImageIO.cxx
@@ -1056,6 +1056,10 @@ void GDALImageIO::InternalWriteImageInformation(const void* buffer)
     }
   else
     {
+    // buffer casted in unsigned long cause under Win32 the adress
+    // don't begin with 0x, the adress in not interpreted as
+    // hexadecimal but alpha numeric value, then the conversion to
+    // integer make us pointing to an non allowed memory block => Crash.
     std::ostringstream stream;
     stream << "MEM:::"
            <<  "DATAPOINTER=" << (unsigned long)(buffer) << ","
-- 
GitLab