shithub: libvpx

Download patch

ref: fd3078fd8fe7b64a70ac740d8302cb457a295115
parent: 5ed84c2fdf420478c19e1c64982a306159077a8d
author: John Koleszar <jkoleszar@google.com>
date: Tue Oct 23 06:59:05 EDT 2012

postproc_sse2: avoid reading off the end of the limits array

Rather than unconditionally reading in the next MB's limits, test
the loop exit condition first.

Change-Id: I105d1e92698fb5561aa87160816787604aed03a2

--- a/vp8/common/x86/postproc_sse2.asm
+++ b/vp8/common/x86/postproc_sse2.asm
@@ -140,12 +140,13 @@
         add         rsi,        16
         add         rdi,        16
 
-        UPDATE_FLIMIT
-
         add         rdx,        16
         cmp         edx,        dword arg(4)     ;cols
-        jl          .nextcol
+        jge         .downdone
+        UPDATE_FLIMIT
+        jmp         .nextcol
 
+.downdone:
         ; done with the all cols, start the across filtering in place
         sub         rsi,        rdx
         sub         rdi,        rdx
@@ -191,12 +192,13 @@
         psrldq      xmm0,       8
         movdq2q     mm1,        xmm0
 
-        UPDATE_FLIMIT
-
         add         rdx,        16
         cmp         edx,        dword arg(4)     ;cols
-        jl          .acrossnextcol;
+        jge         .acrossdone
+        UPDATE_FLIMIT
+        jmp         .acrossnextcol
 
+.acrossdone
         ; last 16 pixels
         movq        QWORD PTR [rdi+rdx-16], mm0