From 1d9fe2a3d60913e51a1413bf3aa10585f28e0437 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Fri, 14 May 2021 02:29:24 -0400 Subject: [PATCH] [mod_flv_streaming] check range before sending FLV check range before sending FLV header --- src/mod_flv_streaming.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mod_flv_streaming.c b/src/mod_flv_streaming.c index 7c7ce73c..c02aec95 100644 --- a/src/mod_flv_streaming.c +++ b/src/mod_flv_streaming.c @@ -123,8 +123,9 @@ URIHANDLER_FUNC(mod_flv_streaming_path_handler) { r->http_status = (errno == ENOENT) ? 404 : 403; return HANDLER_FINISHED; } - - if (0 == sce->st.st_size) + if (len == -1 || sce->st.st_size - start < len) + len = sce->st.st_size - start; + if (len <= 0) return HANDLER_FINISHED; /* if there is a start=[0-9]+ in the header use it as start,