From efdca34f524b8bb36edda5cbef07d13bad089d01 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 28 Feb 2013 14:25:00 +0000 Subject: 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. --- source/blender/blenkernel/intern/movieclip.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/blender/blenkernel/intern/movieclip.c') 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; } -- cgit v1.2.3