Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 684452

Summary: media-video/ffmpeg-3.4.5 with sys-devel/gcc-8 and LTO - segmentation fault in ff_sine_window_init
Product: Gentoo Linux Reporter: Alexander Miller <alex.miller>
Component: Current packagesAssignee: Gentoo Media-video project <media-video>
Status: RESOLVED FIXED    
Severity: normal Keywords: PATCH
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85132
https://trac.ffmpeg.org/ticket/7491
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: ffmpeg-3.4-segfault.patch

Description Alexander Miller 2019-04-27 00:01:40 UTC
Created attachment 574330 [details, diff]
ffmpeg-3.4-segfault.patch

After rebuilding media-video/ffmpeg-3.4.5 with a newer toolchain I got segfaults for most videos I tried to play (with ffplay or mplayer). I found the following upstream commit that addresses the issue but is missing from the 3.4 branch:
https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/10f468156c0109a06854b5d672c5209a88923ce9
The attached patch based on that commit (changes to version.h disabled because they don't apply) fixes the issue for me.

The (unpatched) code writes to some arrays which are declared "const", so it's no surprise this causes segfaults. I think this should be fixed in the stable version even though it apparently works by chance with some toolchains and CFLAGS.
Comment 1 Alexis Ballier gentoo-dev 2019-10-02 10:31:33 UTC
This is fixed in 4.1.3 and later versions