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,