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.
This commit is contained in:
Sergey Sharybin
2013-02-28 14:25:00 +00:00
parent 3e320a67e3
commit efdca34f52

View File

@@ -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;
}