From 65e9216ccea172ee09da0a5ecc6515d7b4c5e443 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Fri, 22 Jun 2012 13:24:43 +0000 Subject: Nullpointer exception happened when all input sockets of a (for example) a translate node were connected with the same complex node (like lens distortion). Added a check to see if the list of buffers are available to resolve this issue. --- .../operations/COM_ReadBufferOperation.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp index d82294dd8a6..857131950dd 100644 --- a/source/blender/compositor/operations/COM_ReadBufferOperation.cpp +++ b/source/blender/compositor/operations/COM_ReadBufferOperation.cpp @@ -48,14 +48,21 @@ void ReadBufferOperation::determineResolution(unsigned int resolution[], unsigne } void ReadBufferOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) { - MemoryBuffer *inputBuffer = inputBuffers[this->offset]; - if (inputBuffer) { - if (sampler == COM_PS_NEAREST) { - inputBuffer->read(color, x, y); - } - else { - inputBuffer->readCubic(color, x, y); + if (inputBuffers) { + MemoryBuffer *inputBuffer = inputBuffers[this->offset]; + if (inputBuffer) { + if (sampler == COM_PS_NEAREST) { + inputBuffer->read(color, x, y); + } + else { + inputBuffer->readCubic(color, x, y); + } } + } else { + color[0] = 0.0f; + color[1] = 0.0f; + color[2] = 0.0f; + color[3] = 0.0f; } } -- cgit v1.2.3