Skip to content

Commit

Permalink
fix for #187
Browse files Browse the repository at this point in the history
  • Loading branch information
barbibulle committed Sep 9, 2017
1 parent 22192de commit 5eb8cf8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/C++/Core/Ap4HdlrAtom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ AP4_HdlrAtom::AP4_HdlrAtom(AP4_UI32 size,
// handle a special case: the Quicktime files have a pascal
// string here, but ISO MP4 files have a C string.
// we try to detect a pascal encoding and correct it.
if (name[0] == name_size-1) {
if ((AP4_UI08)name[0] == (AP4_UI08)(name_size-1)) {
m_HandlerName = name+1;
} else {
m_HandlerName = name;
Expand Down
7 changes: 7 additions & 0 deletions Source/C++/Core/Ap4StszAtom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ AP4_StszAtom::AP4_StszAtom(AP4_UI32 size,
stream.ReadUI32(m_SampleSize);
stream.ReadUI32(m_SampleCount);
if (m_SampleSize == 0) { // means that the samples have different sizes
// check for overflow
if (m_SampleCount > (size-8)/4) {
m_SampleCount = 0;
return;
}

// read the entries
AP4_Cardinal sample_count = m_SampleCount;
m_Entries.SetItemCount(sample_count);
unsigned char* buffer = new unsigned char[sample_count*4];
Expand Down

0 comments on commit 5eb8cf8

Please sign in to comment.