diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2007-03-27 14:13:57 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2007-03-27 14:13:57 +0400 |
commit | e3ff98fc6ba3e9b2ac8887d43a978e3eb7109cb0 (patch) | |
tree | 00d20c8978de049c55e10b9af2a8c50f5e9c777a /source/blender/imbuf | |
parent | 12c8ce44ca00bd99d52ee1ee30c179cc688190f9 (diff) |
=== OpenEXR ===
* fix [ #6105 ] Blender crashes when opening multilayer with node in compositor
- Mem_IStream membuf was allocated on the stack, so it caused major troubles when
out of the function scope. Now allocate it on the heap and let OpenEXR deal with
freeing it.
- moved + added delete file;'s for completeness
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_api.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 983ab101893..3cbada812b9 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -873,9 +873,9 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, int size, int flags) try { - Mem_IStream membuf(mem, size); + Mem_IStream *membuf = new Mem_IStream(mem, size); int is_multi; - file = new InputFile(membuf); + file = new InputFile(*membuf); Box2i dw = file->header().dataWindow(); int width = dw.max.x - dw.min.x + 1; @@ -946,8 +946,8 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, int size, int flags) } } - delete file; } + delete file; return(ibuf); @@ -956,6 +956,7 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, int size, int flags) { std::cerr << exc.what() << std::endl; if (ibuf) IMB_freeImBuf(ibuf); + delete file; return (0); } |