diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-11-20 21:31:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-20 21:31:12 +0100 |
commit | 083d088de3fe7cd5d825cebebc46ce32fc87b4b0 (patch) | |
tree | 9b2524105bf989f6ac0ad1c488ac493f558a391f /core/math | |
parent | 719254ae0d4e1b7c9be36a4399809caf270d7e86 (diff) | |
parent | 99d8626f4a313471410db421891e90fe768cd929 (diff) |
Merge pull request #33583 from qarmin/fix_overflows_unitialized
Fix some overflows and unitialized variables
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/camera_matrix.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index 30c0cab909..b9b0f4ac54 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -183,6 +183,10 @@ void CameraMatrix::set_orthogonal(real_t p_size, real_t p_aspect, real_t p_znear void CameraMatrix::set_frustum(real_t p_left, real_t p_right, real_t p_bottom, real_t p_top, real_t p_near, real_t p_far) { + ERR_FAIL_COND(p_right <= p_left); + ERR_FAIL_COND(p_top <= p_bottom); + ERR_FAIL_COND(p_far <= p_near); + real_t *te = &matrix[0][0]; real_t x = 2 * p_near / (p_right - p_left); real_t y = 2 * p_near / (p_top - p_bottom); |