diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-29 12:59:29 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-29 12:59:29 +0300 |
commit | d4b5dd31a360313734f78a112daf4fd8f26fceb5 (patch) | |
tree | 2f295b68d5d2a968a34198e2583c459b5bc9182e /source/blender/imbuf/intern | |
parent | 32157d8d014bccbdc8b84ad7228986ab7078467f (diff) |
ImBuf: Fixes for openexr images
- Fixed crash loading multilayer EXR
- Fixed another memory leak loading multilayer EXR
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_api.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 33555f0dbb5..e3c02736755 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -1560,7 +1560,6 @@ static ExrHandle *imb_exr_begin_read_mem(IStream &file_stream, MultiPartInputFil std::vector<MultiViewChannelName> channels; GetChannelsInMultiPartFile(*data->ifile, channels); - data->multiView = new StringVector(); imb_exr_get_views(*data->ifile, *data->multiView); for (size_t i = 0; i < channels.size(); i++) { @@ -2048,13 +2047,19 @@ struct ImBuf *imb_load_openexr(const unsigned char *mem, size_t size, int flags, } } + /* file is no longer needed */ + delete membuf; + delete file; } } + else { + delete membuf; + delete file; + } + if (flags & IB_alphamode_detect) ibuf->flags |= IB_alphamode_premul; } - delete file; - delete membuf; return(ibuf); } catch (const std::exception& exc) |