diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-04-16 15:57:22 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2012-04-16 15:57:22 +0400 |
commit | c509f687ca1b8ae58d0286afde49e59ea5556551 (patch) | |
tree | 7286e2a32c783251fa46380702c6ec831038bdbf /source | |
parent | 798385fa903245f1a9819631d3116e05769585da (diff) |
Avoid invalid delete call when loading multilayer EXR files with that don't fit the Blender pass naming scheme. If the imb_exr_begin_read_mem function fails reading the EXR (e.g. because of too many channels per pass) it deletes the file internally, leading to segfault on second delete.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_api.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index caca00cbe20..ff3a816f478 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -1007,7 +1007,6 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, size_t size, int flags) if (handle) { IMB_exr_read_channels(handle); ibuf->userdata= handle; /* potential danger, the caller has to check for this! */ - return ibuf; } } else { @@ -1055,11 +1054,12 @@ struct ImBuf *imb_load_openexr(unsigned char *mem, size_t size, int flags) // // if (flag & IM_rect) // IMB_rect_from_float(ibuf); + + /* file is no longer needed */ + delete file; } } - } - delete file; return(ibuf); } catch (const std::exception &exc) |