[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57202] trunk/blender/source/blender/ compositor/operations/COM_MovieClipOperation.cpp: Fix #35599: MovieClip node crashes when using multilayer exr

Sergey Sharybin sergey.vfx at gmail.com
Sun Jun 2 21:55:57 CEST 2013


Revision: 57202
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57202
Author:   nazgul
Date:     2013-06-02 19:55:57 +0000 (Sun, 02 Jun 2013)
Log Message:
-----------
Fix #35599: MovieClip node crashes when using multilayer exr

Multilayer EXR is not supported as a source for movie clip yet,
but there's no excuse to crash!

Modified Paths:
--------------
    trunk/blender/source/blender/compositor/operations/COM_MovieClipOperation.cpp

Modified: trunk/blender/source/blender/compositor/operations/COM_MovieClipOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_MovieClipOperation.cpp	2013-06-02 18:20:49 UTC (rev 57201)
+++ trunk/blender/source/blender/compositor/operations/COM_MovieClipOperation.cpp	2013-06-02 19:55:57 UTC (rev 57202)
@@ -88,19 +88,25 @@
 
 void MovieClipBaseOperation::executePixel(float output[4], float x, float y, PixelSampler sampler)
 {
-	if (this->m_movieClipBuffer == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
+	ImBuf *ibuf = this->m_movieClipBuffer;
+
+	if (ibuf == NULL || x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight() ) {
 		zero_v4(output);
 	}
+	if (ibuf->rect == NULL && ibuf->rect_float == NULL) {
+		/* Happens for multilayer exr, i.e. */
+		zero_v4(output);
+	}
 	else {
 		switch (sampler) {
 			case COM_PS_NEAREST:
-				nearest_interpolation_color(this->m_movieClipBuffer, NULL, output, x, y);
+				nearest_interpolation_color(ibuf, NULL, output, x, y);
 				break;
 			case COM_PS_BILINEAR:
-				bilinear_interpolation_color(this->m_movieClipBuffer, NULL, output, x, y);
+				bilinear_interpolation_color(ibuf, NULL, output, x, y);
 				break;
 			case COM_PS_BICUBIC:
-				bicubic_interpolation_color(this->m_movieClipBuffer, NULL, output, x, y);
+				bicubic_interpolation_color(ibuf, NULL, output, x, y);
 				break;
 		}
 	}




More information about the Bf-blender-cvs mailing list