diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-01 18:54:05 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-01 18:54:05 +0400 |
commit | 148fdb3a7a4e85fb50db52eec6673b9a501c022b (patch) | |
tree | 3dfe90ff6b83c3c914a58b46058547cfe0ce6279 /source/blender/compositor/operations | |
parent | 34a034fb1be677cddbbcd6c138d51d1a200845fd (diff) |
Color management: fixed crash when freeing context for inactive viewer node
Diffstat (limited to 'source/blender/compositor/operations')
-rw-r--r-- | source/blender/compositor/operations/COM_ViewerBaseOperation.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp b/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp index edaa1c8d3c2..f229c6cf365 100644 --- a/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp +++ b/source/blender/compositor/operations/COM_ViewerBaseOperation.cpp @@ -47,10 +47,13 @@ ViewerBaseOperation::ViewerBaseOperation() : NodeOperation() 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,11 +93,15 @@ void ViewerBaseOperation:: updateImage(rcti *rect) 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; } |