Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2015-10-28 19:05:49 +0300
committerDalai Felinto <dfelinto@gmail.com>2015-10-28 19:06:55 +0300
commit138decb7dc6e4c067c8c290b8a034808893bba1f (patch)
tree846e6a8c494ecbd37cea56700bb83ba36a123ee6 /source/blender/imbuf/intern/openexr/openexr_api.cpp
parent20a94e956a3532ea1f8c58d745f14fab1881ba80 (diff)
Temporary "fix" for crash when saving OpenEXR Multi-View from Image Editor
Diffstat (limited to 'source/blender/imbuf/intern/openexr/openexr_api.cpp')
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index c6140da39a1..ecef621b510 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
+#include <stdexcept>
#include <fstream>
#include <string>
#include <set>
@@ -428,6 +429,14 @@ static bool imb_save_openexr_half(
const size_t offset = view_id * width * height;
RGBAZ *to = pixels + offset;
+ /* TODO (dfelinto)
+ * In some cases we get NULL ibufs, it needs investigation, meanwhile prevent crash
+ * Multiview Render + Image Editor + OpenEXR + Multi-View
+ */
+ if (view_ibuf == NULL) {
+ throw std::runtime_error(std::string("Missing data to write to ") + name);
+ }
+
/* indicate used buffers */
frameBuffer.insert(insertViewName("R", views, view_id), Slice(HALF, (char *) &pixels[offset].r, xstride, ystride));
frameBuffer.insert(insertViewName("G", views, view_id), Slice(HALF, (char *) &pixels[offset].g, xstride, ystride));
@@ -543,6 +552,14 @@ static bool imb_save_openexr_float(
float *rect[4] = {NULL, NULL, NULL, NULL};
ImBuf *view_ibuf = is_multiview ? getbuffer(ibuf->userdata, view_id) : ibuf;
+ /* TODO (dfelinto)
+ * In some cases we get NULL ibufs, it needs investigation, meanwhile prevent crash
+ * Multiview Render + Image Editor + OpenEXR + Multi-View
+ */
+ if (view_ibuf == NULL) {
+ throw std::runtime_error(std::string("Missing data to write to ") + name);
+ }
+
/* last scanline, stride negative */
rect[0] = view_ibuf->rect_float + channels * (height - 1) * width;
rect[1] = (channels >= 2) ? rect[0] + 1 : rect[0];