Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: James Almer <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] Use av_unreachable() instead of av_assert0(0) at the end of non-void functions (PR #21270)
Date: Tue, 23 Dec 2025 01:23:33 -0000
Message-ID: <176645301447.60.839409092490857918@2cb04c0e5124> (raw)

PR #21270 opened by James Almer (jamrial)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21270
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21270.patch

Fixes compilation with gcc-tsan and --disable-optimizations.


>From bb334f05b967673fb7caeb8dcc6469927cc03ddc Mon Sep 17 00:00:00 2001
From: James Almer <jamrial@gmail.com>
Date: Mon, 22 Dec 2025 22:19:01 -0300
Subject: [PATCH 1/3] fftools/ffmpeg_enc: use av_unreachable instead of
 av_assert0(0) at the end of a non-void function

Fixes compilation with gcc-tsan and --disable-optimizations

Signed-off-by: James Almer <jamrial@gmail.com>
---
 fftools/ffmpeg_enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c
index 0f7d961472..a595912933 100644
--- a/fftools/ffmpeg_enc.c
+++ b/fftools/ffmpeg_enc.c
@@ -728,7 +728,7 @@ static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame,
         }
     }
 
-    av_assert0(0);
+    av_unreachable("encode_frame() loop should return");
 }
 
 static enum AVPictureType forced_kf_apply(void *logctx, KeyframeForceCtx *kf,
-- 
2.49.1


>From 3d6ee50fb545dd6dcc2519ecbe5cb52450a53d8b Mon Sep 17 00:00:00 2001
From: James Almer <jamrial@gmail.com>
Date: Mon, 22 Dec 2025 22:19:11 -0300
Subject: [PATCH 2/3] fftools/ffmpeg_sched: use av_unreachable instead of
 av_assert0(0) at the end of a non-void function

Fixes compilation with gcc-tsan and --disable-optimizations

Signed-off-by: James Almer <jamrial@gmail.com>
---
 fftools/ffmpeg_sched.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg_sched.c b/fftools/ffmpeg_sched.c
index c5ee6971f1..0d820acb8e 100644
--- a/fftools/ffmpeg_sched.c
+++ b/fftools/ffmpeg_sched.c
@@ -2654,7 +2654,7 @@ static int task_cleanup(Scheduler *sch, SchedulerNode node)
     case SCH_NODE_TYPE_DEC:         return dec_done   (sch, node.idx);
     case SCH_NODE_TYPE_ENC:         return enc_done   (sch, node.idx);
     case SCH_NODE_TYPE_FILTER_IN:   return filter_done(sch, node.idx);
-    default: av_assert0(0);
+    default: av_unreachable("Invalid node type?");
     }
 }
 
-- 
2.49.1


>From 39ab9effb99651f5fbc289c420e784944485c4cc Mon Sep 17 00:00:00 2001
From: James Almer <jamrial@gmail.com>
Date: Mon, 22 Dec 2025 22:19:37 -0300
Subject: [PATCH 3/3] avcodec/cbs_apv: use av_unreachable instead of
 av_assert0(0) at the end of a non-void function

Fixes compilation with gcc-tsan and --disable-optimizations

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/cbs_apv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/cbs_apv.c b/libavcodec/cbs_apv.c
index be52c2e511..f6f701b9dd 100644
--- a/libavcodec/cbs_apv.c
+++ b/libavcodec/cbs_apv.c
@@ -33,7 +33,7 @@ static int cbs_apv_get_num_comp(const APVRawFrameHeader *fh)
     case APV_CHROMA_FORMAT_4444:
         return 4;
     default:
-        av_assert0(0 && "Invalid chroma_format_idc");
+        av_unreachable("Invalid chroma_format_idc");
     }
 }
 
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2025-12-23  1:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176645301447.60.839409092490857918@2cb04c0e5124 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git