summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/asfdec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 8d6de4a256..4db908d3d9 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -1538,6 +1538,13 @@ static int asf_read_seek(AVFormatContext *s, int stream_index,
return ret;
}
+ /* explicitly handle the case of seeking to 0 */
+ if (!pts) {
+ asf_reset_header(s);
+ avio_seek(s->pb, s->data_offset, SEEK_SET);
+ return 0;
+ }
+
if (!asf->index_read) {
ret = asf_build_simple_index(s, stream_index);
if (ret < 0)