Skip to content

Commit

Permalink
Add boundary checks for Ap4StsdAtom
Browse files Browse the repository at this point in the history
Same problem as before, underflow of bytes_available results in some potential
attack
  • Loading branch information
roticv committed Apr 2, 2024
1 parent b977973 commit 26df396
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Source/C++/Core/Ap4StsdAtom.cpp
Expand Up @@ -87,6 +87,7 @@ AP4_StsdAtom::AP4_StsdAtom(AP4_UI32 size,
AP4_AtomFactory& atom_factory) :
AP4_ContainerAtom(AP4_ATOM_TYPE_STSD, size, false, version, flags)
{
if (size < AP4_FULL_ATOM_HEADER_SIZE + 4) return;
// read the number of entries
AP4_UI32 entry_count;
stream.ReadUI32(entry_count);
Expand Down

0 comments on commit 26df396

Please sign in to comment.