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
1 changed files with 3 additions and 2 deletions

View File

@ -140,7 +140,8 @@ 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));
const char *CodecName = FFMS_GetCodecNameI(Indexer, i);
if (CodecName)
TrackList.insert(std::pair<int,std::string>(i, CodecName));
}
}