From 78242103fb61cf2cbad5a97671caa08739e407d9 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Tue, 19 Dec 2023 13:18:32 +0100 Subject: [PATCH] std::string_view cannot be constructed from nullptr --- src/formatcontext.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/formatcontext.cpp b/src/formatcontext.cpp index c387219b..945b4464 100644 --- a/src/formatcontext.cpp +++ b/src/formatcontext.cpp @@ -39,6 +39,8 @@ int64_t custom_io_seek(void *opaque, int64_t offset, int whence) string_view get_uri(const AVFormatContext *ctx) { #if API_AVFORMAT_URL + if (ctx->url == nullptr) + return {}; return ctx->url; #else return ctx->filename;