This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/8.0
in repository ffmpeg.

The following commit(s) were added to refs/heads/release/8.0 by this push:
     new c0c5477b34 avformat/mux: don't let positive write_trailer ret shadow 
pb failure
c0c5477b34 is described below

commit c0c5477b348242b78a650186dfab602ad983a2d9
Author:     Timo Rothenpieler <[email protected]>
AuthorDate: Thu Sep 24 14:21:41 2026 +0200
Commit:     ffmpeg-devel <[email protected]>
CommitDate: Tue Sep 29 19:25:59 2026 +0000

    avformat/mux: don't let positive write_trailer ret shadow pb failure
    
    (cherry picked from commit 1de217ad4b98163b7f5a372853b1c943ed6f070d)
---
 libavformat/avformat.h | 2 +-
 libavformat/mux.c      | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index be6e532387..8dbb246865 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2568,7 +2568,7 @@ int av_write_uncoded_frame_query(AVFormatContext *s, int 
stream_index);
  * May only be called after a successful call to avformat_write_header.
  *
  * @param s media file handle
- * @return 0 if OK, AVERROR_xxx on error
+ * @return >=0 if OK, AVERROR_xxx on error
  */
 int av_write_trailer(AVFormatContext *s);
 
diff --git a/libavformat/mux.c b/libavformat/mux.c
index db3b6c2bfe..4a68c19f60 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1268,8 +1268,8 @@ int av_write_trailer(AVFormatContext *s)
 
     if (s->pb)
        avio_flush(s->pb);
-    if (ret == 0)
-       ret = s->pb ? s->pb->error : 0;
+    if (ret >= 0 && s->pb && s->pb->error < 0)
+       ret = s->pb->error;
     for (unsigned i = 0; i < s->nb_streams; i++) {
         av_freep(&s->streams[i]->priv_data);
         av_freep(&ffstream(s->streams[i])->index_entries);

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to