summaryrefslogtreecommitdiff
path: root/libavcodec/x86/hevc_mc.asm
diff options
context:
space:
mode:
authorMickaƫl Raulet <mraulet@insa-rennes.fr>2014-08-25 10:03:49 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-04 21:14:15 +0200
commit4ba6371a83c914c978aa22b804f00fb876397d98 (patch)
tree1aa65953d4d8dfad9b798dc8de343afe830a0b38 /libavcodec/x86/hevc_mc.asm
parentdf8394c693d3c1e13b7ebf6af01c5e55321cf952 (diff)
x86/hevc: get rid off packusdw for ssse3 compatibility
cherry picked from commit df8ebe304df453f26c28ff8f11d607f49b90a4c2 Fixes out of array access Fixes: asan_stack-oob_1046454_9_asan_stack-oob_15a9e7c_170_WP_MAIN10_B_Toshiba_3.bit Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86/hevc_mc.asm')
-rw-r--r--libavcodec/x86/hevc_mc.asm6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/x86/hevc_mc.asm b/libavcodec/x86/hevc_mc.asm
index e12620089f..eaa070c342 100644
--- a/libavcodec/x86/hevc_mc.asm
+++ b/libavcodec/x86/hevc_mc.asm
@@ -1203,11 +1203,12 @@ cglobal hevc_put_hevc_uni_w%1_%2, 6, 6, 7, dst, dststride, src, srcstride, heigh
paddd m0, m3
paddd m1, m3
%endif
- packusdw m0, m1
+ packssdw m0, m1
%if %2 == 8
packuswb m0, m0
%else
pminsw m0, [max_pixels_%2]
+ pmaxsw m0, [zero]
%endif
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride
@@ -1274,11 +1275,12 @@ cglobal hevc_put_hevc_bi_w%1_%2, 5, 7, 10, dst, dststride, src, srcstride, src2,
psrad m0, m5
psrad m1, m5
%endif
- packusdw m0, m1
+ packssdw m0, m1
%if %2 == 8
packuswb m0, m0
%else
pminsw m0, [max_pixels_%2]
+ pmaxsw m0, [zero]
%endif
PEL_%2STORE%1 dstq, m0, m1
add dstq, dststrideq ; dst += dststride