From ed5e311336a634393189e3e8585e5cd1363f2a6f Mon Sep 17 00:00:00 2001 From: pingkai Date: Fri, 7 Feb 2020 11:00:46 +0800 Subject: [PATCH] fix(HLSStream): fix crash when webvtt no X-TIMESTAMP-MAP Signed-off-by: pingkai --- framework/demuxer/play_list/HLSStream.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framework/demuxer/play_list/HLSStream.cpp b/framework/demuxer/play_list/HLSStream.cpp index 48b590c0c..1c8c7d06b 100644 --- a/framework/demuxer/play_list/HLSStream.cpp +++ b/framework/demuxer/play_list/HLSStream.cpp @@ -1458,6 +1458,11 @@ namespace Cicada { * does not say so) */ char *hls_timestamp_map = strstr(reinterpret_cast(mBuffer), "\nX-TIMESTAMP-MAP="); + + if (hls_timestamp_map == nullptr) { + return mMapPTS; + } + char *native_str = strstr(hls_timestamp_map, "LOCAL:"); char *mpegts_str = strstr(hls_timestamp_map, "MPEGTS:");