1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avcodec/ppc/hpeldsp_altivec: Fix left-shift of negative number

It is UB and affected e.g. the vp5 and vp61 FATE tests:
https://fate.ffmpeg.org/report.cgi?time=20240327083327&slot=ppc-linux-gcc-13.2-ubsan-altivec-qemu

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-03-29 01:10:10 +01:00
parent 3f863f089c
commit 356610a2ac

View File

@ -41,9 +41,9 @@ void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t li
register vector unsigned char pixelsv1D;
int i;
register ptrdiff_t line_size_2 = line_size << 1;
register ptrdiff_t line_size_2 = line_size * (1 << 1);
register ptrdiff_t line_size_3 = line_size + line_size_2;
register ptrdiff_t line_size_4 = line_size << 2;
register ptrdiff_t line_size_4 = line_size * (1 << 2);
// hand-unrolling the loop by 4 gains about 15%
// mininum execution time goes from 74 to 60 cycles