record: fix stream rec segfault

This commit is contained in:
Jacek Jendrzej
2019-05-16 16:47:36 +02:00
parent cf9d1eecbf
commit 086578fdb2

View File

@@ -2217,7 +2217,7 @@ bool CStreamRec::Open(CZapitChannel * channel)
#if (LIBAVFORMAT_VERSION_MAJOR < 58) #if (LIBAVFORMAT_VERSION_MAJOR < 58)
snprintf(ofcx->filename, sizeof(ofcx->filename), "%s", tsfile.c_str()); snprintf(ofcx->filename, sizeof(ofcx->filename), "%s", tsfile.c_str());
#else #else
snprintf(ofcx->url, tsfile.size() + 1, "%s", tsfile.c_str()); ofcx->url = av_strdup(!tsfile.empty() ? tsfile.c_str() : "");
#endif #endif
stream_index = -1; stream_index = -1;