Compositor: Fix compilation error and crash when using defocus search
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 5 Jul 2017 13:37:33 +0000 (15:37 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 5 Jul 2017 13:37:33 +0000 (15:37 +0200)
Was just wondering what the option is doing. Not sure yet, but let's fix
couple of issues here.

source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp

index 1ec52571be8f8eb755a9b1b01811051bbe262f94..9ff0bf9ce123b3a9f698d70af346d61f8414fa15 100644 (file)
@@ -286,9 +286,9 @@ void InverseSearchRadiusOperation::initExecution()
        this->m_inputRadius = this->getInputSocketReader(0);
 }
 
-voi *InverseSearchRadiusOperation::initializeTileData(rcti *rect)
+void *InverseSearchRadiusOperation::initializeTileData(rcti *rect)
 {
-       MemoryBuffer * data = new MemoryBuffer(NULL, rect);
+       MemoryBuffer * data = new MemoryBuffer(COM_DT_COLOR, rect);
        float *buffer = data->getBuffer();
        int x, y;
        int width = this->m_inputRadius->getWidth();
@@ -343,7 +343,7 @@ voi *InverseSearchRadiusOperation::initializeTileData(rcti *rect)
 void InverseSearchRadiusOperation::executePixelChunk(float output[4], int x, int y, void *data)
 {
        MemoryBuffer *buffer = (MemoryBuffer *)data;
-       buffer->readNoCheck(color, x, y);
+       buffer->readNoCheck(output, x, y);
 }
 
 void InverseSearchRadiusOperation::deinitializeTileData(rcti *rect, void *data)