diff --git a/src/lib/OpenEXRUtil/ImfCheckFile.cpp b/src/lib/OpenEXRUtil/ImfCheckFile.cpp index c2cb7fd54d..8b99111d5b 100644 --- a/src/lib/OpenEXRUtil/ImfCheckFile.cpp +++ b/src/lib/OpenEXRUtil/ImfCheckFile.cpp @@ -537,7 +537,7 @@ readDeepTile(T& in,bool reduceMemory , bool reduceTime) int numXLevels = in.numXLevels(); - localSampleCount.resizeErase(height, width); + localSampleCount.resizeErase( tileHeight , tileWidth ); int channelCount=0; for(ChannelList::ConstIterator i=fileHeader.channels().begin();i!=fileHeader.channels().end();++i, channelCount++); @@ -546,25 +546,19 @@ readDeepTile(T& in,bool reduceMemory , bool reduceTime) for (int i = 0; i < channelCount; i++) { - data[i].resizeErase(height, width); + data[i].resizeErase( tileHeight , tileWidth ); } DeepFrameBuffer frameBuffer; - // - // memOffset is difference in bytes between theoretical address of pixel (0,0) and the origin of the data window - // - uint64_t memOffset = sizeof(unsigned int) * (static_cast(dataWindow.min.x) + static_cast(dataWindow.min.y) * width); - // // Use integer arithmetic instead of pointer arithmetic to compute offset into array. // if memOffset is larger than base, then the computed pointer is negative, which is reported as undefined behavior // Instead, integers are used for computation which behaves as expected an all known architectures // - intptr_t base = reinterpret_cast(&localSampleCount[0][0] ); frameBuffer.insertSampleCountSlice (Slice (UINT, - reinterpret_cast (base - memOffset), + reinterpret_cast(&localSampleCount[0][0]), sizeof (unsigned int) * 1, sizeof (unsigned int) * width, 0.0, // fill @@ -580,11 +574,10 @@ readDeepTile(T& in,bool reduceMemory , bool reduceTime) int sampleSize = sizeof (float); int pointerSize = sizeof (char *); - intptr_t base = reinterpret_cast(&data[channel][0][0]); frameBuffer.insert (i.name(), DeepSlice (FLOAT, - reinterpret_cast (base- memOffset), + reinterpret_cast(&data[channel][0][0]), pointerSize * 1, pointerSize * width, sampleSize,