Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-07-13 16:55:30 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-13 16:55:30 +0400
commita5e6d73d412146cf9cdd077aec0b71cb615dd361 (patch)
tree9fe04bf28a78e2b6f35b9d069229dbb76717fd0f /source/blender/compositor/operations/COM_MaskOperation.cpp
parent6eacb5791df99f9204d0a478698158ef994d3e1d (diff)
fix for crash with new rasterizer
Diffstat (limited to 'source/blender/compositor/operations/COM_MaskOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_MaskOperation.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/compositor/operations/COM_MaskOperation.cpp b/source/blender/compositor/operations/COM_MaskOperation.cpp
index 5674582a21a..d2a4854efee 100644
--- a/source/blender/compositor/operations/COM_MaskOperation.cpp
+++ b/source/blender/compositor/operations/COM_MaskOperation.cpp
@@ -147,13 +147,15 @@ void MaskOperation::initExecution()
{
initMutex();
- if (this->m_rasterMaskHandle == NULL) {
- const int width = this->getWidth();
- const int height = this->getHeight();
+ if (this->m_mask) {
+ if (this->m_rasterMaskHandle == NULL) {
+ const int width = this->getWidth();
+ const int height = this->getHeight();
- this->m_rasterMaskHandle = BLI_maskrasterize_handle_new();
+ this->m_rasterMaskHandle = BLI_maskrasterize_handle_new();
- BLI_maskrasterize_handle_init(this->m_rasterMaskHandle, this->m_mask, width, height, TRUE, this->m_do_smooth, this->m_do_feather);
+ BLI_maskrasterize_handle_init(this->m_rasterMaskHandle, this->m_mask, width, height, TRUE, this->m_do_smooth, this->m_do_feather);
+ }
}
}
@@ -194,7 +196,12 @@ void MaskOperation::determineResolution(unsigned int resolution[], unsigned int
void MaskOperation::executePixel(float *color, int x, int y, void *data)
{
const float xy[2] = {x / (float)this->m_maskWidth, y / (float)this->m_maskHeight};
- color[0] = BLI_maskrasterize_handle_sample(this->m_rasterMaskHandle, xy);
+ if (this->m_rasterMaskHandle) {
+ color[0] = BLI_maskrasterize_handle_sample(this->m_rasterMaskHandle, xy);
+ }
+ else {
+ color[0] = 0.0f;
+ }
}
#endif /* USE_RASKTER */