[FFmpeg-devel] [PATCH 2/2] avformat/aviobuf: Forward error codes in avio_seek

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Tue May 14 11:49:49 EEST 2019


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavformat/aviobuf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 5c01423a2e..2462b95b16 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -293,8 +293,11 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
                (!s->direct || !s->seek)) {
         while(s->pos < offset && !s->eof_reached)
             fill_buffer(s);
-        if (s->eof_reached)
+        if (s->eof_reached) {
+            if (s->error)
+                return s->error;
             return AVERROR_EOF;
+        }
         s->buf_ptr = s->buf_end - (s->pos - offset);
     } else if(!s->write_flag && offset1 < 0 && -offset1 < buffer_size>>1 && s->seek && offset > 0) {
         int64_t res;
-- 
2.21.0



More information about the ffmpeg-devel mailing list