• Yang Wang's avatar
    dsputil_mmx: fix incorrect assembly code · 845e92fd
    Yang Wang authored
    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: 's avatarMichael Niedermayer <michaelni@gmx.at>
    Signed-off-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
    845e92fd
Name
Last commit
Last update
..
Makefile Loading commit data...
ac3dsp.asm Loading commit data...
ac3dsp_mmx.c Loading commit data...
cabac.h Loading commit data...
cavsdsp_mmx.c Loading commit data...
dct32_sse.asm Loading commit data...
deinterlace.asm Loading commit data...
dnxhd_mmx.c Loading commit data...
dsputil_mmx.c Loading commit data...
dsputil_mmx.h Loading commit data...
dsputil_mmx_avg_template.c Loading commit data...
dsputil_mmx_qns_template.c Loading commit data...
dsputil_mmx_rnd_template.c Loading commit data...
dsputil_yasm.asm Loading commit data...
dsputilenc_mmx.c Loading commit data...
dsputilenc_yasm.asm Loading commit data...
fdct_mmx.c Loading commit data...
fft.c Loading commit data...
fft.h Loading commit data...
fft_3dn.c Loading commit data...
fft_3dn2.c Loading commit data...
fft_mmx.asm Loading commit data...
fmtconvert.asm Loading commit data...
fmtconvert_mmx.c Loading commit data...
h264_chromamc.asm Loading commit data...
h264_chromamc_10bit.asm Loading commit data...
h264_deblock.asm Loading commit data...
h264_deblock_10bit.asm Loading commit data...
h264_i386.h Loading commit data...
h264_idct.asm Loading commit data...
h264_idct_10bit.asm Loading commit data...
h264_intrapred.asm Loading commit data...
h264_intrapred_10bit.asm Loading commit data...
h264_intrapred_init.c Loading commit data...
h264_qpel_10bit.asm Loading commit data...
h264_qpel_mmx.c Loading commit data...
h264_weight.asm Loading commit data...
h264_weight_10bit.asm Loading commit data...
h264dsp_mmx.c Loading commit data...
idct_mmx.c Loading commit data...
idct_mmx_xvid.c Loading commit data...
idct_sse2_xvid.c Loading commit data...
idct_xvid.h Loading commit data...
imdct36_sse.asm Loading commit data...
lpc_mmx.c Loading commit data...
mathops.h Loading commit data...
mlpdsp.c Loading commit data...
motion_est_mmx.c Loading commit data...
mpegaudiodec_mmx.c Loading commit data...
mpegvideo_mmx.c Loading commit data...
mpegvideo_mmx_template.c Loading commit data...
pngdsp-init.c Loading commit data...
pngdsp.asm Loading commit data...
proresdsp-init.c Loading commit data...
proresdsp.asm Loading commit data...
rv34dsp.asm Loading commit data...
rv34dsp_init.c Loading commit data...
rv40dsp.asm Loading commit data...
rv40dsp_init.c Loading commit data...
sbrdsp.asm Loading commit data...
sbrdsp_init.c Loading commit data...
simple_idct_mmx.c Loading commit data...
snowdsp_mmx.c Loading commit data...
vc1dsp_mmx.c Loading commit data...
vc1dsp_yasm.asm Loading commit data...
vp3dsp.asm Loading commit data...
vp3dsp_init.c Loading commit data...
vp56_arith.h Loading commit data...
vp56dsp.asm Loading commit data...
vp56dsp_init.c Loading commit data...
vp8dsp-init.c Loading commit data...
vp8dsp.asm Loading commit data...
w64xmmtest.c Loading commit data...