summaryrefslogtreecommitdiff
path: root/graphics/ffmpeg/patches/patch-libavformat_utils_c
diff options
context:
space:
mode:
authorShokara Kou <kou@13f0.net>2024-03-04 17:07:52 -0500
committerShokara Kou <kou@13f0.net>2024-03-04 17:07:52 -0500
commit763d5a7382ce7b713511fb4b0ac1ce097508e8f6 (patch)
tree5999155de987b3127beba5917d16a1f5e2f77fad /graphics/ffmpeg/patches/patch-libavformat_utils_c
parent1c7977bb95a42b7792fb8b7b4a11c0afe4697a01 (diff)
import graphics/ffmpeg
Diffstat (limited to 'graphics/ffmpeg/patches/patch-libavformat_utils_c')
-rw-r--r--graphics/ffmpeg/patches/patch-libavformat_utils_c24
1 files changed, 24 insertions, 0 deletions
diff --git a/graphics/ffmpeg/patches/patch-libavformat_utils_c b/graphics/ffmpeg/patches/patch-libavformat_utils_c
new file mode 100644
index 0000000..fa0c918
--- /dev/null
+++ b/graphics/ffmpeg/patches/patch-libavformat_utils_c
@@ -0,0 +1,24 @@
1llvm 16 optimizations lead to a segfault when seeking in opus files because
2checks that could leave pos_max uninitialized are optimized away, leading
3to out-of-bounds reads from the guard pages.
4
5av_uninit() is complete batshittery:
6
7https://marc.info/?l=openbsd-ports&m=170284868209618&w=2
8
9Turns out the same commit has landed upstream:
10
11https://github.com/FFmpeg/FFmpeg/commit/ab792634197e364ca1bb194f9abe36836e42f12d
12
13Index: libavformat/utils.c
14--- libavformat/utils.c.orig
15+++ libavformat/utils.c
16@@ -2146,7 +2146,7 @@ int ff_seek_frame_binary(AVFormatContext *s, int strea
17 int64_t target_ts, int flags)
18 {
19 const AVInputFormat *avif = s->iformat;
20- int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit;
21+ int64_t pos_min = 0, pos_max = 0, pos, pos_limit;
22 int64_t ts_min, ts_max, ts;
23 int index;
24 int64_t ret;