From 82b68c6a40dbf4d21cfc86baf5bf089bdd561981 Mon Sep 17 00:00:00 2001 From: stone Date: Tue, 13 Apr 2021 19:18:06 +0800 Subject: [PATCH] bugfix: SrsAsyncCallWorker::cycle to crash --- trunk/src/app/srs_app_config.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index 56fefb336a..b499cc764f 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -279,7 +279,13 @@ bool srs_config_apply_filter(SrsConfDirective* dvr_apply, SrsRequest* req) { static bool DEFAULT = true; - if (!dvr_apply || dvr_apply->args.empty()) { + // if dvr_apply is null, return false to keep consistency with get_dvr_enabled() function + // if not, will occasionally cause SrsAsyncCallWorker::cycle to crash down with trd == 0x00 + if ( !dvr_apply ){ + return false; + } + + if ( dvr_apply->args.empty()) { return DEFAULT; }