Fix crash when working with invalid file https://github.com/TechSmith/mp4v2/commit/aa06c07ec0b0e0e1b6dd82bf32821668059e8662 --- src/mp4file.cpp.orig +++ src/mp4file.cpp @@ -3461,6 +3461,9 @@ const char *MP4File::GetTrackMediaDataName (MP4TrackId trackId) MP4Atom *pAtom = FindAtom(MakeTrackName(trackId, "mdia.minf.stbl.stsd")); + if ( pAtom == nullptr ) + return nullptr; + if (pAtom->GetNumberOfChildAtoms() != 1) { log.errorf("%s: \"%s\": track %d has more than 1 child atoms in stsd", __FUNCTION__, GetFilename().c_str(), trackId);