mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 10:40:05 +08:00
Prevent access to nullptr when cloning a track
This commit is contained in:
parent
dfda93a4c4
commit
6514be74f1
@ -37,6 +37,7 @@ bool MediaSink::addTrack(const Track::Ptr &track_in) {
|
||||
}
|
||||
// 克隆Track,只拷贝其数据,不拷贝其数据转发关系
|
||||
auto track = track_in->clone();
|
||||
CHECK(track, "Clone track failed: ", track_in->getCodecName());
|
||||
auto index = track->getIndex();
|
||||
if (!_track_map.emplace(index, std::make_pair(track, false)).second) {
|
||||
WarnL << "Already add a same track: " << track->getIndex() << ", codec: " << track->getCodecName();
|
||||
|
Loading…
Reference in New Issue
Block a user