diff options
author | Habib Gahbiche <zazizizou> | 2021-01-28 12:43:29 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2021-01-28 12:43:46 +0300 |
commit | 51c8d53a7d0e1dfa151482420e2b19ae2ee10c9b (patch) | |
tree | 03868f9af6e033345097b925c0dfd20be8050f00 /source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp | |
parent | 61d1fd7e2f8b972b903fa6684114a13f652fd507 (diff) |
Fix T84512: Crash if size input of Blur node is too large
Gaussian filter with a too large kernel doesn't make much sense.
This commit caps the Gaussian function radius to MAX_GAUSSTAB_RADIUS.
Reviewed By: sergey
Maniphest Tasks: T84512
Differential Revision: https://developer.blender.org/D10122
Diffstat (limited to 'source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp index e4401b2a91c..e08d30e5ddf 100644 --- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp @@ -66,6 +66,7 @@ void GaussianXBlurOperation::updateGauss() if (this->m_gausstab == nullptr) { updateSize(); float rad = max_ff(m_size * m_data.sizex, 0.0f); + rad = min_ff(rad, MAX_GAUSSTAB_RADIUS); m_filtersize = min_ii(ceil(rad), MAX_GAUSSTAB_RADIUS); this->m_gausstab = BlurBaseOperation::make_gausstab(rad, m_filtersize); |