Commit d7436e44d9 for ffmpeg
commit d7436e44d99807e3d2488b753e209725b439ff97
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Fri Nov 27 23:34:27 2026 +0000
avformat/segment: propagate errors closing the separate header
The AVIO buffer may still hold header bytes after the child muxer flush. Propagate any error writing them when the initialization file is closed.
Assisted-by: Fairy
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 676661613e..ce93512a28 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -864,7 +864,9 @@ static int seg_write_header(AVFormatContext *s)
if (ret < 0)
return ret;
if (seg->header_filename) {
- ff_format_io_close(oc, &oc->pb);
+ ret = ff_format_io_close(oc, &oc->pb);
+ if (ret < 0)
+ return ret;
} else {
close_null_ctxp(&oc->pb);
seg->is_nullctx = 0;