[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48468] branches/soc-2011-tomato/source/ blender/compositor/operations/COM_ViewerBaseOperation.cpp: Color management : fixed crash when freeing context for inactive viewer node

Sergey Sharybin sergey.vfx at gmail.com
Sun Jul 1 16:54:14 CEST 2012


Revision: 48468
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48468
Author:   nazgul
Date:     2012-07-01 14:54:05 +0000 (Sun, 01 Jul 2012)
Log Message:
-----------
Color management: fixed crash when freeing context for inactive viewer node

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp

Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp	2012-07-01 13:57:32 UTC (rev 48467)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp	2012-07-01 14:54:05 UTC (rev 48468)
@@ -47,10 +47,13 @@
 	this->m_outputBufferDisplay = NULL;
 	this->m_active = false;
 	this->m_doColorManagement = true;
+	this->m_partialBufferUpdate = NULL;
 }
 
 void ViewerBaseOperation::initExecution()
 {
+	this->m_partialBufferUpdate = NULL;
+
 	if (isActiveViewerOutput()) {
 		initImage();
 	}
@@ -90,12 +93,16 @@
 
 void ViewerBaseOperation::deinitExecution()
 {
-	ImBuf *ibuf = BKE_image_acquire_ibuf(this->m_image, this->m_imageUser, &this->m_lock);
+	if (this->m_partialBufferUpdate) {
+		/* partial buffer context could be NULL if it's not active viewer node */
 
-	IMB_partial_buffer_update_free(this->m_partialBufferUpdate, ibuf);
+		ImBuf *ibuf = BKE_image_acquire_ibuf(this->m_image, this->m_imageUser, &this->m_lock);
 
-	BKE_image_release_ibuf(this->m_image, this->m_lock);
+		IMB_partial_buffer_update_free(this->m_partialBufferUpdate, ibuf);
 
+		BKE_image_release_ibuf(this->m_image, this->m_lock);
+	}
+
 	this->m_outputBuffer = NULL;
 }
 




More information about the Bf-blender-cvs mailing list