[Bf-blender-cvs] [75e2ae72c77] master: Allow for multi-gigapixel renders
Karl Semich
noreply at git.blender.org
Mon Jan 15 12:57:25 CET 2018
Commit: 75e2ae72c7771a89f3fe4e988d4deb30c9367313
Author: Karl Semich
Date: Mon Jan 15 12:53:17 2018 +0100
Branches: master
https://developer.blender.org/rB75e2ae72c7771a89f3fe4e988d4deb30c9367313
Allow for multi-gigapixel renders
This patch fixes a 32-bit overflow that occurs on 64-bit systems due to a numeric literal being treated as 32-bit.
This patch allows for the generation of images that occupy more than 4GB of RAM, which previously caused a crash.
Reviewers: sergey
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D2975
===================================================================
M source/blender/imbuf/intern/openexr/openexr_api.cpp
===================================================================
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index 2fa830dc42a..539b9fa45b4 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -1028,13 +1028,13 @@ void IMB_exr_write_channels(void *handle)
for (size_t i = 0; i < num_pixels; ++i, ++cur) {
*cur = rect[i * echan->xstride];
}
- half *rect_to_write = current_rect_half + (data->height - 1) * data->width;
+ half *rect_to_write = current_rect_half + (data->height - 1L) * data->width;
frameBuffer.insert(echan->name, Slice(Imf::HALF, (char *)rect_to_write,
sizeof(half), -data->width * sizeof(half)));
current_rect_half += num_pixels;
}
else {
- float *rect = echan->rect + echan->xstride * (data->height - 1) * data->width;
+ float *rect = echan->rect + echan->xstride * (data->height - 1L) * data->width;
frameBuffer.insert(echan->name, Slice(Imf::FLOAT, (char *)rect,
echan->xstride * sizeof(float), -echan->ystride * sizeof(float)));
}
More information about the Bf-blender-cvs
mailing list