[FFmpeg-devel] [PATCH 5/6] dashdec: Avoid trying to read any segments beyond the last

刘歧 lq at chinaffmpeg.org
Mon Jan 8 04:58:14 EET 2018


> On 8 Jan 2018, at 02:46, Stefan _ <sfan5 at live.de> wrote:
> 
> 
> <0005-dashdec-Avoid-trying-to-read-any-segments-beyond-the.patch>_______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

>From 277c710159849816bff4e4f5ccd1139348518620 Mon Sep 17 00:00:00 2001
From: sfan5 <sfan5 at live.de>
Date: Fri, 5 Jan 2018 14:19:25 +0100
Subject: [PATCH 5/6] dashdec: Avoid trying to read any segments beyond the
 last

---
 libavformat/dashdec.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 1252d4156..af8ab5f2f 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1505,9 +1505,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;
-- 
2.15.1



LGTM

Thanks

Steven



More information about the ffmpeg-devel mailing list