Warning, /graphics/krita/3rdparty/ext_ffmpeg/0002-ffmpeg-Fix-crashes-in-ff_seek_frame_binary-if-built-with-la.patch is written in an unsupported language. File is not indexed.
0001 From eb3a284b4cebfa56eaa11523ebd943fb131b7ea1 Mon Sep 17 00:00:00 2001 0002 From: Dmitry Kazakov <dimula73@gmail.com> 0003 Date: Tue, 11 Apr 2023 11:02:21 +0200 0004 Subject: [PATCH 2/3] -Fix crashes in ff_seek_frame_binary if built with latest 0005 Clang 14 0006 0007 Passing an uninitialized variable as argument to a function is 0008 undefined behaviour (UB). The compiler can assume that UB does not 0009 happen. 0010 0011 Hence, the compiler can assume that the variables are never 0012 uninitialized when passed as argument, which means that the codepaths 0013 that initializes them must be taken. 0014 0015 In ff_seek_frame_binary, this means that the compiler can assume 0016 that the codepaths that initialize pos_min and pos_max are taken, 0017 which means that the conditions "if (sti->index_entries)" and 0018 "if (index >= 0)" can be optimized out. 0019 0020 Current Clang git versions (upcoming Clang 14) enabled an optimization 0021 that does this, which broke the current version of this function 0022 (which intentionally left the variables uninitialized, but silencing 0023 warnings about being uninitialized). See [1] for discussion on 0024 the matter. 0025 0026 [1] https://reviews.llvm.org/D105169#3069555 0027 0028 Original commit: 0029 0030 https://github.com/FFmpeg/FFmpeg/commit/ab792634197e364ca1bb194f9abe36836e42f12d 0031 0032 --- 0033 libavformat/utils.c | 2 +- 0034 1 file changed, 1 insertion(+), 1 deletion(-) 0035 0036 diff --git a/libavformat/utils.c b/libavformat/utils.c 0037 index b2d011a0db..d79a13ca7a 100644 0038 --- a/libavformat/utils.c 0039 +++ b/libavformat/utils.c 0040 @@ -2146,7 +2146,7 @@ int ff_seek_frame_binary(AVFormatContext *s, int stream_index, 0041 int64_t target_ts, int flags) 0042 { 0043 const AVInputFormat *avif = s->iformat; 0044 - int64_t av_uninit(pos_min), av_uninit(pos_max), pos, pos_limit; 0045 + int64_t pos_min = 0, pos_max = 0, pos, pos_limit; 0046 int64_t ts_min, ts_max, ts; 0047 int index; 0048 int64_t ret; 0049 -- 0050 2.40.1.windows.1 0051