1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00
FFmpeg/libavcodec/x86
Yang Wang 845e92fd6a dsputil_mmx: fix incorrect assembly code
In ff_put_pixels_clamped_mmx(), there are two assembly code blocks.
In the first block (in the unrolled loop), the instructions
"movq 8%3, %%mm1 \n\t", and so forth, have problems.

From above instruction, it is clear what the programmer wants: a load from
p + 8. But this assembly code doesn’t guarantee that. It only works if the
compiler puts p in a register to produce an instruction like this:
"movq 8(%edi), %mm1". During compiler optimization, it is possible that the
compiler will be able to constant propagate into p. Suppose p = &x[10000].
Then operand 3 can become 10000(%edi), where %edi holds &x. And the instruction
becomes "movq 810000(%edx)". That is, it will stride by 810000 instead of 8.

This will cause a segmentation fault.

This error was fixed in the second block of the assembly code, but not in
the unrolled loop.

How to reproduce:
    This error is exposed when we build using Intel C++ Compiler, with
    IPO+PGO optimization enabled. Crashed when decoding an MJPEG video.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2012-07-25 14:22:18 -04:00
..
ac3dsp_mmx.c
ac3dsp.asm
cabac.h x86: place some inline asm under #if HAVE_INLINE_ASM 2012-06-25 13:23:12 +01:00
cavsdsp_mmx.c x86: place some inline asm under #if HAVE_INLINE_ASM 2012-06-25 13:23:12 +01:00
dct32_sse.asm
deinterlace.asm
dnxhd_mmx.c x86: place some inline asm under #if HAVE_INLINE_ASM 2012-06-25 13:23:12 +01:00
dsputil_mmx_avg_template.c
dsputil_mmx_qns_template.c
dsputil_mmx_rnd_template.c
dsputil_mmx.c dsputil_mmx: fix incorrect assembly code 2012-07-25 14:22:18 -04:00
dsputil_mmx.h x86: remove unused inline asm macros from dsputil_mmx.h 2012-06-23 14:14:06 +01:00
dsputil_yasm.asm dsputil: x86: add SHUFFLE_MASK_W macro 2012-07-22 16:56:58 -04:00
dsputilenc_mmx.c dsputilenc: group yasm and inline asm function pointer assignment. 2012-07-04 07:46:27 -07:00
dsputilenc_yasm.asm
fdct_mmx.c
fft_3dn2.c
fft_3dn.c
fft_mmx.asm x86: fft: replace call to memcpy by a loop 2012-06-27 12:49:33 +01:00
fft.c
fft.h
fmtconvert_mmx.c x86: fmtconvert: add special asm for float_to_int16_interleave_misc_* 2012-06-30 19:10:36 +03:00
fmtconvert.asm x86: fmtconvert: add special asm for float_to_int16_interleave_misc_* 2012-06-30 19:10:36 +03:00
h264_chromamc_10bit.asm
h264_chromamc.asm
h264_deblock_10bit.asm
h264_deblock.asm
h264_i386.h x86: place some inline asm under #if HAVE_INLINE_ASM 2012-06-25 13:23:12 +01:00
h264_idct_10bit.asm
h264_idct.asm
h264_intrapred_10bit.asm
h264_intrapred_init.c x86: h264_intrapred: port to cpuflag macros 2012-07-05 17:37:10 +02:00
h264_intrapred.asm x86: h264_intrapred: Don't add the 'd' suffix to the SPLATB_REG macro 2012-07-06 21:07:23 +03:00
h264_qpel_10bit.asm
h264_qpel_mmx.c
h264_weight_10bit.asm
h264_weight.asm
h264dsp_mmx.c x86: Only use optimizations with cmov if the CPU supports the instruction 2012-06-23 16:21:50 +02:00
idct_mmx_xvid.c
idct_mmx.c
idct_sse2_xvid.c
idct_xvid.h
imdct36_sse.asm
lpc_mmx.c x86: place some inline asm under #if HAVE_INLINE_ASM 2012-06-25 13:23:12 +01:00
Makefile vp3: move idct and loop filter pointers to new vp3dsp context 2012-07-18 10:32:19 +01:00
mathops.h x86: place some inline asm under #if HAVE_INLINE_ASM 2012-06-25 13:23:12 +01:00
mlpdsp.c
motion_est_mmx.c
mpegaudiodec_mmx.c
mpegvideo_mmx_template.c
mpegvideo_mmx.c
pngdsp-init.c
pngdsp.asm
proresdsp-init.c
proresdsp.asm
rv34dsp_init.c
rv34dsp.asm
rv40dsp_init.c cosmetics: do not use full path for local headers 2012-06-22 10:49:40 +02:00
rv40dsp.asm
sbrdsp_init.c
sbrdsp.asm
simple_idct_mmx.c
snowdsp_mmx.c x86: place some inline asm under #if HAVE_INLINE_ASM 2012-06-25 13:23:12 +01:00
vc1dsp_mmx.c x86: vc1: fix and enable optimised loop filter 2012-06-30 00:12:05 +01:00
vc1dsp_yasm.asm x86: vc1: fix and enable optimised loop filter 2012-06-30 00:12:05 +01:00
vp3dsp_init.c vp3: move idct and loop filter pointers to new vp3dsp context 2012-07-18 10:32:19 +01:00
vp3dsp.asm vp3: move idct and loop filter pointers to new vp3dsp context 2012-07-18 10:32:19 +01:00
vp8dsp-init.c vp8: Add ifdef guards around the sse2 loopfilter in the sse2slow branch too 2012-07-05 09:39:01 +03:00
vp8dsp.asm x86inc: add SPLATB_LOAD, SPLATB_REG, PSHUFLW macros 2012-07-05 17:37:11 +02:00
vp56_arith.h
vp56dsp_init.c
vp56dsp.asm
w64xmmtest.c