]> granicus.if.org Git - libvpx/commitdiff
postproc_sse2: avoid reading off the end of the limits array
authorJohn Koleszar <jkoleszar@google.com>
Tue, 23 Oct 2012 17:59:05 +0000 (10:59 -0700)
committerJohn Koleszar <jkoleszar@google.com>
Tue, 23 Oct 2012 17:59:05 +0000 (10:59 -0700)
Rather than unconditionally reading in the next MB's limits, test
the loop exit condition first.

Change-Id: I105d1e92698fb5561aa87160816787604aed03a2

vp8/common/x86/postproc_sse2.asm

index 25c32e148b7c13b81c06e26e05e8ec2187313825..00f84a31b21d9a8f03178222a3365b1aca955956 100644 (file)
@@ -140,12 +140,13 @@ sym(vp8_post_proc_down_and_across_mb_row_sse2):
         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 @@ sym(vp8_post_proc_down_and_across_mb_row_sse2):
         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