Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-03-06 17:57:28 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-03-06 17:57:28 +0400
commitc6f7c97daa269711db41c4a9e84d05eb20245a6c (patch)
tree4128e2de9204c054fb0223f49eae0ae32d952e60 /source/blender
parent3882f7cde740ee0fd74b0da3ef7f6044d894df71 (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.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_movieclip.c11
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;