This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit a53f3f861388da37ac5c02397a7eee11b71c3fad Author: Andreas Rheinhardt <[email protected]> AuthorDate: Wed Aug 12 13:22:19 2026 +0200 Commit: Andreas Rheinhardt <[email protected]> CommitDate: Thu Aug 13 13:17:30 2026 +0200 avcodec/svq1enc: Workaround GCC bug 102513 encode_blocks() in svq1enc.c triggers a bug in several versions of GCC: GCC tries to create eight clones of recursive functions to inline some parameters when it deems this worth it. Yet encode_blocks() only has a recursion depth of six and the last two clones contained out-of-bounds array accesses, triggering -Warray-bounds warnings. This has already caused problems in the past, see 894191e7e10520109db983032d1cd8d45c85af6d which disabled the creation of clones for GCC < 12; GCC 12 itself got better at not creating unnecessary clones and therefore was not targetted by this. Yet since GCC 16 (commit 3fd5a1e76bbf1bc031934a9d96f284a22a5f307f), it again fails at discarding unneeded clones and emits warnings again. This patch fixes this by simply telling the compiler the proper range via an av_assume(); this also allows to remove the old workaround for GCC 11. Furthermore, GCC 12-15 still produced insane output: Six clones for encode_block() and a general function without inlined parameters that is not referenced by anything. The av_assume() eliminates this function, too. Reviewed-by: Kacper Michajłow <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]> --- libavcodec/svq1enc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index 4855bed188..953e235b13 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -48,12 +48,6 @@ #include "libavutil/frame.h" #include "libavutil/mem_internal.h" -// Workaround for GCC bug 102513 -#if AV_GCC_VERSION_AT_LEAST(10, 0) && AV_GCC_VERSION_AT_MOST(12, 0) \ - && !defined(__clang__) && !defined(__INTEL_COMPILER) -#pragma GCC optimize ("no-ipa-cp-clone") -#endif - typedef struct SVQ1EncContext { /* FIXME: Needed for motion estimation, should not be used for anything * else, the idea is to make the motion estimation eventually independent @@ -134,6 +128,8 @@ static int encode_block(SVQ1EncContext *s, uint8_t *src, uint8_t *ref, uint8_t *decoded, int stride, unsigned level, int threshold, int lambda, int intra) { + av_assume(level <= 5U); // Workaround for GCC bug 102513 + int count, y, x, i, j, split, best_mean, best_score, best_count; int best_vector[6]; int block_sum[7] = { 0, 0, 0, 0, 0, 0 }; _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
