]> granicus.if.org Git - libvpx/commit
Fix stack corruption with x86 and --enable-pic
authorMatthias Räncker <theonetruecamper@gmx.de>
Mon, 17 Sep 2018 11:57:17 +0000 (13:57 +0200)
committerJohann Koenig <johannkoenig@google.com>
Tue, 18 Sep 2018 17:33:19 +0000 (17:33 +0000)
commit347d01811538f89fac6ffb34af3adf87dc945822
tree69c5ac98f62b24c7271ad28e87a43e118e0b5541
parent7323218a5e390c20c2db71a158bee53b695958e7
Fix stack corruption with x86 and --enable-pic

x86inc.asm's cglobal macro is frequently used to declare more
arguments than the function actually has. Normally, this is
done to aquire an alias to a register that would correspond to
that positional function argument if it existed. This is safe
when used in this manner.
In the case fixed here, however, the alias is used to temporarily
store adresses obtained through the GOT in memory. Because those
extra arguments don't actually exist, those stores corrupt the
callers stack frame.
SSE2/VpxHBDSubpelVarianceTest.Ref is a test that may fail as a
result.
To simply fix the space allocated to actual arguments that have
been loaded into registers already is reused.
This avoids having to allocate extra space for local variables.

Also removed duplicate code while at it.

Signed-off-by: Matthias Räncker <theonetruecamper@gmx.de>
Change-Id: I505281ecaa6be586185fe6a2d34d62bdf40c839f
vpx_dsp/x86/highbd_subpel_variance_impl_sse2.asm
vpx_dsp/x86/subpel_variance_sse2.asm