mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-03-14 08:17:41 +01:00
Up until now, several altivec-specific fields are directly put into SwsInternal #if HAVE_ALTIVEC is true. These fields are of altivec-specific vector types and therefore require altivec specific headers to be included. Unfortunately, said altivec specific headers redefine bool in a manner that is incompatible with stdbool. swscale/ops.h uses bool and this led graph.c and ops.c to disagree about the layout of structures from ops.h, leading to heap corruption [1], [2] in the sws-unscaled FATE test. Fix this by moving the altivec-specific parts out of SwsInternal and into a structure that extends SwsInternal and is allocated jointly with it. Said structure is local to yuv2rgb_altivec.c, because this is the only file accessing said fields. Should more files need them, an altivec-specific swscale header would need to be added. Thanks to jfiusdq <jfiusdq@proton.me> for analyzing the issue. [1]: https://fate.ffmpeg.org/report.cgi?slot=ppc64-linux-gcc-14.3-asan&time=20260224065643 [2]: https://fate.ffmpeg.org/report.cgi?slot=ppc64-linux-gcc-14.3&time=20260224051615 Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>