From ae086225daea14890cad1273d6a68d1daf7399b3 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 21 Feb 2016 13:16:00 +0100 Subject: Fix compositor using edge repeat policy when it shouldn't Was easy to notice when alpha-overing smaller image with blur on the bigger frame. --- source/blender/compositor/intern/COM_MemoryBuffer.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/compositor') diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h index f9e2dd87d05..a8e34543e08 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.h +++ b/source/blender/compositor/intern/COM_MemoryBuffer.h @@ -259,6 +259,12 @@ public: float u = x; float v = y; this->wrap_pixel(u, v, extend_x, extend_y); + if ((extend_x != COM_MB_REPEAT && (u < 0.0f || u >= this->m_width)) || + (extend_y != COM_MB_REPEAT && (v < 0.0f || v >= this->m_height))) + { + zero_v4(result); + return; + } BLI_bilinear_interpolation_wrap_fl( this->m_buffer, result, this->m_width, this->m_height, this->m_num_channels, u, v, extend_x == COM_MB_REPEAT, extend_y == COM_MB_REPEAT); -- cgit v1.2.3