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

Git pushed a commit to branch master
in repository ffmpeg.

commit 5422569d6a84d4d358d4ef9eb4fd128a3b0f85d2
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Tue Oct 13 05:52:20 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Tue Oct 20 20:41:50 2026 +0000

    avformat/aviobuf: retry the read after AVERROR(EAGAIN)
    
    Fixes: 3Fn44aM2tqIx
    Fixes: infinite loop
    Infinite loop Replicated through UnModified FFmpeg with a nonblocking pipe 
and timeout
    Found during the review of https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24909
---
 libavformat/aviobuf.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index edbbc5ffd6..43431381b9 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -520,6 +520,11 @@ static void fill_buffer(AVIOContext *s)
                           s->buf_end : s->buffer;
     int len             = s->buffer_size - (dst - s->buffer);
 
+    if (s->error == AVERROR(EAGAIN)) {
+        s->error       = 0;
+        s->eof_reached = 0;
+    }
+
     /* can't fill the buffer without read_packet, just set EOF if appropriate 
*/
     if (!s->read_packet && s->buf_ptr >= s->buf_end)
         s->eof_reached = 1;
@@ -622,6 +627,10 @@ int avio_read(AVIOContext *s, unsigned char *buf, int size)
         if (len == 0 || s->write_flag) {
             if((s->direct || size > s->buffer_size) && !s->update_checksum && 
s->read_packet) {
                 // bypass the buffer and read data directly into buf
+                if (s->error == AVERROR(EAGAIN)) {
+                    s->error       = 0;
+                    s->eof_reached = 0;
+                }
                 len = read_packet_wrapper(s, buf, size);
                 if (len == AVERROR_EOF) {
                     /* do not modify buffer if EOF reached so that a seek back 
can

-- 
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