Fix crash when FFMS_GetCodecNameI returns NULL

This commit is contained in:
Thomas Goyne 2013-12-10 12:37:03 -08:00
parent 16d55f9d64
commit d4c831e346

View file

@ -140,8 +140,9 @@ std::map<int, std::string> FFmpegSourceProvider::GetTracksOfType(FFMS_Indexer *I
for (int i=0; i<NumTracks; i++) {
if (FFMS_GetTrackTypeI(Indexer, i) == Type) {
std::string CodecName(FFMS_GetCodecNameI(Indexer, i));
TrackList.insert(std::pair<int,std::string>(i, CodecName));
const char *CodecName = FFMS_GetCodecNameI(Indexer, i);
if (CodecName)
TrackList.insert(std::pair<int,std::string>(i, CodecName));
}
}
return TrackList;