[x265] [PATCH] SAO: avoid access beyond bounds

praveen at multicorewareinc.com praveen at multicorewareinc.com
Mon Feb 9 12:39:23 CET 2015


# 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);


More information about the x265-devel mailing list