History

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

Andreas Rheinhardt committed 2 years ago

Commit 356610a1 parent 3f863f01 file · +2 −2Browse files

Showing the changes to libavcodec/ppc (1 of 1 file). Show all

Unified · Split

libavcodec/ppc/hpeldsp_altivec.c+2−2
@@ -41,9 +41,9 @@ void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t li · 40 unmodified lines
4141 register vector unsigned char pixelsv1D;
4242
4343 int i;
44− register ptrdiff_t line_size_2 = line_size << 1;
44+ register ptrdiff_t line_size_2 = line_size * (1 << 1);
4545 register ptrdiff_t line_size_3 = line_size + line_size_2;
46− register ptrdiff_t line_size_4 = line_size << 2;
46+ register ptrdiff_t line_size_4 = line_size * (1 << 2);
4747
4848 // hand-unrolling the loop by 4 gains about 15%
4949 // mininum execution time goes from 74 to 60 cycles

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t