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:
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/compositor/intern/COM_MemoryBuffer.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp
index 74991738d7a..aa2a5475d38 100644
--- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp
+++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp
@@ -295,7 +295,12 @@ void MemoryBuffer::readEWA(float result[4], const float uv[2], const float deriv
zero_v4(result);
return;
}
- /* TODO(sergey): Consider clamping u1/v1/u2/v2 to the m_rect. */
+
+ /* Clamp sampling rectagle to the buffer dimensions. */
+ u1 = max_ii(u1, m_rect.xmin);
+ u2 = min_ii(u2, m_rect.xmax);
+ v1 = max_ii(v1, m_rect.ymin);
+ v2 = min_ii(v2, m_rect.ymax);
float DDQ = 2.0f * A;
float U = u1 - U0;