From 356d4c3085bcff1664cdf1d57ac325323d66e519 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 13 May 2013 11:52:04 +0000 Subject: Fix #35330: Blur node crash due to size overflow Issue was caused by too hight value used for size, which came from infinite Z-buffer point. Solved the crash by clamoing maximal gaussian table radius to 30K, which seems to be reasonable. --- source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp') diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp index af231d118a6..13b749f8b9c 100644 --- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp @@ -53,8 +53,7 @@ void GaussianXBlurOperation::initExecution() if (this->m_sizeavailable) { float rad = this->m_size * this->m_data->sizex; - if (rad < 1) - rad = 1; + CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS); this->m_rad = rad; this->m_gausstab = BlurBaseOperation::make_gausstab(rad); @@ -66,8 +65,7 @@ void GaussianXBlurOperation::updateGauss() if (this->m_gausstab == NULL) { updateSize(); float rad = this->m_size * this->m_data->sizex; - if (rad < 1) - rad = 1; + CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS); this->m_rad = rad; this->m_gausstab = BlurBaseOperation::make_gausstab(rad); -- cgit v1.2.3