Fix truncation warning.

pull/3538/head
Doug Nazar 2022-07-22 19:52:09 -04:00
parent 3b69a51ff8
commit c030416500
1 changed files with 2 additions and 1 deletions

View File

@ -290,7 +290,8 @@ AVFormatContext *SessionDescriptor::generateFormatContext() const {
#if (LIBAVFORMAT_VERSION_CHECK(58, 12, 0, 0, 100)) #if (LIBAVFORMAT_VERSION_CHECK(58, 12, 0, 0, 100))
formatContext->url = av_strdup(mUrl.c_str()); formatContext->url = av_strdup(mUrl.c_str());
#else #else
strncpy(formatContext->filename, mUrl.c_str(), sizeof(formatContext->filename)); strncpy(formatContext->filename, mUrl.c_str(), sizeof(formatContext->filename) - 1);
formatContext->filename[sizeof(formatContext->filename) - 1] = '\0';
#endif #endif
/* /*
if ( mName.length() ) if ( mName.length() )