[FFmpeg-cvslog] avfilter/x86/vf_interlace : avfilter/x86/vf_interlace : fix crash when using unaligned data in low_pass complex

Martin Vignali git at videolan.org
Fri Dec 15 12:29:50 EET 2017


ffmpeg | branch: master | Martin Vignali <martin.vignali at gmail.com> | Thu Dec 14 17:55:11 2017 +0100| [3c6dc270355f27645cf931fae1ed2dc1405507f8] | committer: Martin Vignali

avfilter/x86/vf_interlace : avfilter/x86/vf_interlace : fix crash when using unaligned data in low_pass complex

related to ticket 6491

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3c6dc270355f27645cf931fae1ed2dc1405507f8
---

 libavfilter/x86/vf_interlace.asm | 47 +++++++++++++++++++++-------------------
 1 file changed, 25 insertions(+), 22 deletions(-)

diff --git a/libavfilter/x86/vf_interlace.asm b/libavfilter/x86/vf_interlace.asm
index f83538872d..06b269828a 100644
--- a/libavfilter/x86/vf_interlace.asm
+++ b/libavfilter/x86/vf_interlace.asm
@@ -73,8 +73,8 @@ cglobal lowpass_line_16, 5, 5, 7, dst, h, src, mref, pref
 cglobal lowpass_line_complex, 5, 5, 8, dst, h, src, mref, pref
     pxor m7, m7
 .loop:
-    mova m0, [srcq+mrefq]
-    mova m2, [srcq+prefq]
+    movu m0, [srcq+mrefq]
+    movu m2, [srcq+prefq]
     mova m1, m0
     mova m3, m2
     punpcklbw m0, m7
@@ -85,7 +85,7 @@ cglobal lowpass_line_complex, 5, 5, 8, dst, h, src, mref, pref
     paddw m1, m3
     mova m6, m0
     mova m5, m1
-    mova m2, [srcq]
+    movu m2, [srcq]
     mova m3, m2
     punpcklbw m2, m7
     punpckhbw m3, m7
@@ -100,8 +100,8 @@ cglobal lowpass_line_complex, 5, 5, 8, dst, h, src, mref, pref
     pcmpgtw m6, m2
     pcmpgtw m5, m3
     packsswb m6, m5
-    mova m2, [srcq+mrefq*2]
-    mova m4, [srcq+prefq*2]
+    movu m2, [srcq+mrefq*2]
+    movu m4, [srcq+prefq*2]
     mova m3, m2
     mova m5, m4
     punpcklbw m2, m7
@@ -118,8 +118,9 @@ cglobal lowpass_line_complex, 5, 5, 8, dst, h, src, mref, pref
     psrlw m1, 3
     packuswb m0, m1
     mova m1, m0
-    pmaxub m0, [srcq]
-    pminub m1, [srcq]
+    movu m2, [srcq]
+    pmaxub m0, m2
+    pminub m1, m2
     pand m0, m6
     pandn m6, m1
     por m0, m6
@@ -134,18 +135,18 @@ REP_RET
 cglobal lowpass_line_complex_12, 5, 5, 8, 16, dst, h, src, mref, pref, clip_max
     movd m7, DWORD clip_maxm
     SPLATW m7, m7, 0
-    mova [rsp], m7
+    movu [rsp], m7
 .loop:
-    mova m0, [srcq+mrefq]
-    mova m1, [srcq+mrefq+mmsize]
-    mova m2, [srcq+prefq]
-    mova m3, [srcq+prefq+mmsize]
+    movu m0, [srcq+mrefq]
+    movu m1, [srcq+mrefq+mmsize]
+    movu m2, [srcq+prefq]
+    movu m3, [srcq+prefq+mmsize]
     paddw m0, m2
     paddw m1, m3
     mova m6, m0
     mova m7, m1
-    mova m2, [srcq]
-    mova m3, [srcq+mmsize]
+    movu m2, [srcq]
+    movu m3, [srcq+mmsize]
     paddw m0, m2
     paddw m1, m3
     psllw m2, 1
@@ -156,10 +157,10 @@ cglobal lowpass_line_complex_12, 5, 5, 8, 16, dst, h, src, mref, pref, clip_max
     psllw m1, 1
     pcmpgtw m6, m2
     pcmpgtw m7, m3
-    mova m2, [srcq+2*mrefq]
-    mova m3, [srcq+2*mrefq+mmsize]
-    mova m4, [srcq+2*prefq]
-    mova m5, [srcq+2*prefq+mmsize]
+    movu m2, [srcq+2*mrefq]
+    movu m3, [srcq+2*mrefq+mmsize]
+    movu m4, [srcq+2*prefq]
+    movu m5, [srcq+2*prefq+mmsize]
     paddw m2, m4
     paddw m3, m5
     paddw m0, [pw_4]
@@ -172,10 +173,12 @@ cglobal lowpass_line_complex_12, 5, 5, 8, 16, dst, h, src, mref, pref, clip_max
     pminsw m1, [rsp]
     mova m2, m0
     mova m3, m1
-    pmaxsw m0, [srcq]
-    pmaxsw m1, [srcq+mmsize]
-    pminsw m2, [srcq]
-    pminsw m3, [srcq+mmsize]
+    movu m4, [srcq]
+    pmaxsw m0, m4
+    pminsw m2, m4
+    movu m4, [srcq + mmsize]
+    pmaxsw m1, m4
+    pminsw m3, m4
     pand m0, m6
     pand m1, m7
     pandn m6, m2



More information about the ffmpeg-cvslog mailing list