Revision: 48892
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48892
Author: campbellbarton
Date: 2012-07-13 12:55:30 +0000 (Fri, 13 Jul 2012)
Log Message:
-----------
fix for crash with new rasterizer
Modified Paths:
--------------
trunk/blender/source/blender/compositor/operations/COM_MaskOperation.cpp
Modified:
trunk/blender/source/blender/compositor/operations/COM_MaskOperation.cpp
===================================================================
--- trunk/blender/source/blender/compositor/operations/COM_MaskOperation.cpp
2012-07-13 12:50:10 UTC (rev 48891)
+++ trunk/blender/source/blender/compositor/operations/COM_MaskOperation.cpp
2012-07-13 12:55:30 UTC (rev 48892)
@@ -147,13 +147,15 @@
{
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::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 */
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs