dashdec: Avoid trying to read any segments beyond the last
authorsfan5 <sfan5@live.de>
Sun, 14 Jan 2018 15:01:45 +0000 (23:01 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Sun, 14 Jan 2018 15:01:45 +0000 (23:01 +0800)
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavformat/dashdec.c

index 05b6021..2427ad0 100644 (file)
@@ -1503,9 +1503,11 @@ restart:
     if (ret > 0)
         goto end;
 
-    if (!v->is_restart_needed)
-        v->cur_seq_no++;
-    v->is_restart_needed = 1;
+    if (c->is_live || v->cur_seq_no < v->last_seq_no) {
+        if (!v->is_restart_needed)
+            v->cur_seq_no++;
+        v->is_restart_needed = 1;
+    }
 
 end:
     return ret;