* [FFmpeg-devel] [PATCH] Use av_unreachable() instead of av_assert0(0) at the end of non-void functions (PR #21270)
@ 2025-12-23 1:23 James Almer via ffmpeg-devel
0 siblings, 0 replies; only message in thread
From: James Almer via ffmpeg-devel @ 2025-12-23 1:23 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: James Almer
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-12-23 1:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-23 1:23 [FFmpeg-devel] [PATCH] Use av_unreachable() instead of av_assert0(0) at the end of non-void functions (PR #21270) James Almer via ffmpeg-devel
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