[FFmpeg-devel] [PATCH 2/3] lavf/avidec: don't treat I/O errors as EOF

Rodger Combs rodger.combs at gmail.com
Wed Nov 28 09:19:58 EET 2018


---
 libavformat/avidec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 3f074795a7..1d131b299c 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1383,8 +1383,8 @@ static int ni_prepare_read(AVFormatContext *s)
     if (i >= 0) {
         int64_t pos = best_st->index_entries[i].pos;
         pos += best_ast->packet_size - best_ast->remaining;
-        if (avio_seek(s->pb, pos + 8, SEEK_SET) < 0)
-          return AVERROR_EOF;
+        if ((pos = avio_seek(s->pb, pos + 8, SEEK_SET)) < 0)
+          return pos;
 
         av_assert0(best_ast->remaining <= best_ast->packet_size);
 
-- 
2.19.1



More information about the ffmpeg-devel mailing list