diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-03-06 17:57:28 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-03-06 17:57:28 +0400 |
commit | c6f7c97daa269711db41c4a9e84d05eb20245a6c (patch) | |
tree | 4128e2de9204c054fb0223f49eae0ae32d952e60 | |
parent | 3882f7cde740ee0fd74b0da3ef7f6044d894df71 (diff) |
Fix for crash when loading some mango files
Seems that issue is caused by several threads accessing to movie clip and one
of the threads (compositor node) was editing ImBuf which isn't nice anyway.
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_movieclip.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_movieclip.c b/source/blender/nodes/composite/nodes/node_composite_movieclip.c index 1f449f8c16a..6ec64ef7c09 100644 --- a/source/blender/nodes/composite/nodes/node_composite_movieclip.c +++ b/source/blender/nodes/composite/nodes/node_composite_movieclip.c @@ -44,20 +44,23 @@ static bNodeSocketTemplate cmp_node_movieclip_out[]= { static CompBuf *node_composit_get_movieclip(RenderData *rd, MovieClip *clip, MovieClipUser *user) { - ImBuf *ibuf; + ImBuf *orig_ibuf, *ibuf; CompBuf *stackbuf; int type; float *rect; int alloc= FALSE; - ibuf= BKE_movieclip_get_ibuf(clip, user); + orig_ibuf= BKE_movieclip_get_ibuf(clip, user); - if(ibuf==NULL || (ibuf->rect==NULL && ibuf->rect_float==NULL)) { - IMB_freeImBuf(ibuf); + if(orig_ibuf==NULL || (orig_ibuf->rect==NULL && orig_ibuf->rect_float==NULL)) { + IMB_freeImBuf(orig_ibuf); return NULL; } + ibuf= IMB_dupImBuf(orig_ibuf); + IMB_freeImBuf(orig_ibuf); + if (ibuf->rect_float == NULL || ibuf->userflags&IB_RECT_INVALID) { IMB_float_from_rect(ibuf); ibuf->userflags&= ~IB_RECT_INVALID; |