diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index ac3d28afcd..fec564a768 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -5747,6 +5747,11 @@ TLS/connection diagnostics), set ``--msg-level=curl=trace``. ``--curl-enabled=`` Enable the libcurl-based network backend (default: ``yes``). + Defaults to ``no`` with libavformat < 62.15.101, which has a nested IO + cleanup bug that can cause crashes or memory leaks. The issue happens only + on transfer failures or aborts, can be enabled if you don't mind possible + stability issues. + ``--curl-http-version=`` Select the maximum HTTP protocol version libcurl is allowed to negotiate. If libcurl was built without HTTP/3 support, it will fallback to ``auto``. diff --git a/stream/stream_curl.c b/stream/stream_curl.c index 992af8dcca..f0e8dcedb6 100644 --- a/stream/stream_curl.c +++ b/stream/stream_curl.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -106,7 +107,9 @@ const struct m_sub_options curl_conf = { {0} }, .defaults = &(const struct curl_opts) { - .enabled = true, + // Older lavf has a bug with nested IO cleanup, disable by default. + // + .enabled = LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(62, 15, 101), .http_version = CURL_HTTP_VERSION_NONE, .max_redirects = 16, .max_retries = 5,