<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><pre>we will access m_tmpU1[-1], so we need modify initialize pointer with +1 offset</pre><pre><br>At 2015-02-09 19:39:23,praveen@multicorewareinc.com wrote:
># HG changeset patch
># User Praveen Tiwari
># Date 1423481955 -19800
># Node ID 61f2083a51de7f604a00c053ab60ba6a9f70b708
># Parent b6f36b277234d7f402d67986dab969e7bc655646
>SAO: avoid access beyond bounds
>
>diff -r b6f36b277234 -r 61f2083a51de source/encoder/sao.cpp
>--- a/source/encoder/sao.cpp Fri Feb 06 21:57:45 2015 -0600
>+++ b/source/encoder/sao.cpp Mon Feb 09 17:09:15 2015 +0530
>@@ -113,8 +113,8 @@
>
> for (int i = 0; i < 3; i++)
> {
>- CHECKED_MALLOC(m_tmpU1[i], pixel, m_param->sourceWidth);
>- CHECKED_MALLOC(m_tmpU2[i], pixel, m_param->sourceWidth);
>+ CHECKED_MALLOC(m_tmpU1[i], pixel, m_param->sourceWidth + 2); // +2 for SAO asm code to avoid access beyond bounds
>+ CHECKED_MALLOC(m_tmpU2[i], pixel, m_param->sourceWidth + 2);
> }
>
> CHECKED_MALLOC(m_count, PerClass, NUM_PLANE);
</pre></div>