diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-02-28 18:25:00 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-02-28 18:25:00 +0400 |
commit | efdca34f524b8bb36edda5cbef07d13bad089d01 (patch) | |
tree | b064b4ddcc6688bf7c2862d03a63096705c357f0 /source/blender/blenkernel/intern/movieclip.c | |
parent | 3e320a67e3fa1226c95bb37250649fb26f0d916e (diff) |
Fix memory leak when loading multilayer EXR as movie clip
Such kind of image sequences wouldn't be displayed still
and supporting them would take some additional time, but
for now it'll be no memory leak on attempt opening such
images.
Diffstat (limited to 'source/blender/blenkernel/intern/movieclip.c')
-rw-r--r-- | source/blender/blenkernel/intern/movieclip.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index eceac61ddb6..2702d5b3f0a 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -81,6 +81,10 @@ #include "IMB_imbuf.h" #include "IMB_moviecache.h" +#ifdef WITH_OPENEXR +#include "intern/openexr/openexr_multi.h" +#endif + /*********************** movieclip buffer loaders *************************/ static int sequence_guess_offset(const char *full_name, int head_len, unsigned short numlen) @@ -221,6 +225,13 @@ static ImBuf *movieclip_load_sequence_file(MovieClip *clip, MovieClipUser *user, /* read ibuf */ ibuf = IMB_loadiffname(name, loadflag, colorspace); +#ifdef WITH_OPENEXR + if (ibuf->ftype == OPENEXR && ibuf->userdata) { + IMB_exr_close(ibuf->userdata); + ibuf->userdata = NULL; + } +#endif + return ibuf; } |