diff mbox series

[FFmpeg-devel] avformat/mov: Properly forward error codes from av_seek

Message ID 20210325163240.450743-1-derek.buitenhuis@gmail.com
State New
Headers show
Series [FFmpeg-devel] avformat/mov: Properly forward error codes from av_seek
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Derek Buitenhuis March 25, 2021, 4:32 p.m. UTC
This is important, for example, for connection timed out events,
when used ovr a network, returning AVERROR(ETIMEDOUT).

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
---
 libavformat/mov.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index aef5517c2c..bd78e68c16 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -7947,8 +7947,10 @@  static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
                    sc->ffindex, sample->pos);
             if (should_retry(sc->pb, ret64)) {
                 mov_current_sample_dec(sc);
-            }
-            return AVERROR_INVALIDDATA;
+            } else if (ret64 < 0)
+                return (int)ret64;
+            else
+                return AVERROR_INVALIDDATA;
         }
 
         if (st->discard == AVDISCARD_NONKEY && !(sample->flags & AVINDEX_KEYFRAME)) {