Skip to content

Commit

Permalink
Add more error checking for ftyp atom
Browse files Browse the repository at this point in the history
  • Loading branch information
KMojek committed Oct 28, 2024
1 parent e228196 commit 6ef0136
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/atom_ftyp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ void MP4FtypAtom::Generate()

void MP4FtypAtom::Read()
{
<<<<<<< Updated upstream
if ( m_size == 0ULL )
return;
=======
if ( m_size < 8ULL )
throw new Exception( "Invalid ftyp atom size", __FILE__, __LINE__, __FUNCTION__ );
>>>>>>> Stashed changes

compatibleBrands.SetCount( (m_size - 8) / 4 ); // brands array fills rest of atom
MP4Atom::Read();
Expand Down

0 comments on commit 6ef0136

Please sign in to comment.