Skip to content
Permalink
Browse files Browse the repository at this point in the history
fixed possible crashes on malformed inputs.
  • Loading branch information
barbibulle committed Jul 30, 2017
1 parent 2a940e8 commit 4d3f0be
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Source/C++/Core/Ap4AtomSampleTable.cpp
Expand Up @@ -87,6 +87,11 @@ AP4_AtomSampleTable::GetSample(AP4_Ordinal index,
{
AP4_Result result;

// check that we have an stsc atom
if (!m_StscAtom) {
return AP4_ERROR_INVALID_FORMAT;
}

// check that we have a chunk offset table
if (m_StcoAtom == NULL && m_Co64Atom == NULL) {
return AP4_ERROR_INVALID_FORMAT;
Expand Down
2 changes: 1 addition & 1 deletion Source/C++/Core/Ap4AvccAtom.cpp
Expand Up @@ -270,7 +270,7 @@ AP4_AvccAtom::InspectFields(AP4_AtomInspector& inspector)
for (unsigned int i=0; i<m_SequenceParameters.ItemCount(); i++) {
inspector.AddField("Sequence Parameter", m_SequenceParameters[i].GetData(), m_SequenceParameters[i].GetDataSize());
}
for (unsigned int i=0; i<m_SequenceParameters.ItemCount(); i++) {
for (unsigned int i=0; i<m_PictureParameters.ItemCount(); i++) {
inspector.AddField("Picture Parameter", m_PictureParameters[i].GetData(), m_PictureParameters[i].GetDataSize());
}
return AP4_SUCCESS;
Expand Down
1 change: 1 addition & 0 deletions Source/C++/Core/Ap4Processor.cpp
Expand Up @@ -554,6 +554,7 @@ AP4_Processor::Process(AP4_ByteStream& input,
int cursor = -1;
for (unsigned int i=0; i<track_count; i++) {
if (!cursors[i].m_EndReached &&
cursors[i].m_Locator.m_SampleTable &&
cursors[i].m_Locator.m_Sample.GetOffset() <= min_offset) {
min_offset = cursors[i].m_Locator.m_Sample.GetOffset();
cursor = i;
Expand Down
4 changes: 2 additions & 2 deletions Source/C++/Core/Ap4Version.h
Expand Up @@ -37,7 +37,7 @@
/**
* Version number of the SDK
*/
#define AP4_VERSION 0x01050000
#define AP4_VERSION_STRING "1.5.0.0"
#define AP4_VERSION 0x01050001
#define AP4_VERSION_STRING "1.5.0.1"

#endif // _AP4_VERSION_H_

0 comments on commit 4d3f0be

Please sign in to comment.