Commit b5902e69c7 for ffmpeg
commit b5902e69c71bf556958f9fded99d1bcea2d7298c
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Wed Oct 7 01:27:55 2026 +0200
avformat/dash: Do not write into zero sized buffers in ff_dash_fill_tmpl_params()
The check is the one recommended in the report.
Fixes: lNi0cBMALYfT
Fixes: AISLE-2026-0111-00522
Fixes: AISLE-2026-0110-00522
Fixes: AISLE-2026-0109-00522
Found-by: Joshua Rogers <joshua.rogers@aisle.com>
diff --git a/libavformat/dash.c b/libavformat/dash.c
index fddfa82340..6c27fb5781 100644
--- a/libavformat/dash.c
+++ b/libavformat/dash.c
@@ -98,6 +98,8 @@ void ff_dash_fill_tmpl_params(char *dst, size_t buffer_size,
int64_t time) {
int dst_pos = 0;
const char *t_cur = template;
+ if (!buffer_size)
+ return;
while (dst_pos < buffer_size - 1 && *t_cur) {
char format_tag[7]; // May be "%d", "%0Xd", or "%0Xlld" (for $Time$), where X is in [0-9]
int n = 0;