Skip to content

Commit

Permalink
Revert "fix dangling pointer for subtream object, in order to change …
Browse files Browse the repository at this point in the history
…author."

This reverts commit 1ddc9c9.
  • Loading branch information
XingzhaoYun committed Oct 30, 2024
1 parent 1ddc9c9 commit 88361d8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
8 changes: 1 addition & 7 deletions Source/C++/Codecs/Ap4Ac4Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,11 @@ AP4_Ac4Header::AP4_Ac4Header(const AP4_UI08* bytes, unsigned int size)
AP4_Ac4Header::~AP4_Ac4Header()
{
if (m_PresentationV1) {
bool removed_ss[32];
AP4_SetMemory(removed_ss, false, sizeof(removed_ss));
assert(m_PresentationV1 != NULL);
for (unsigned int pres_idx = 0; pres_idx < m_NPresentations; pres_idx++) {
assert(m_PresentationV1[pres_idx].d.v1.substream_groups != NULL);
for (int j = 0; j < m_PresentationV1[pres_idx].d.v1.n_substream_groups; j++)
if (removed_ss[m_PresentationV1[pres_idx].d.v1.substream_groups[j].d.v1.substreams->ss_idx]) break;
else{
removed_ss[m_PresentationV1[pres_idx].d.v1.substream_groups[j].d.v1.substreams->ss_idx] = true;
delete[] m_PresentationV1[pres_idx].d.v1.substream_groups[j].d.v1.substreams;
}
delete[] m_PresentationV1[pres_idx].d.v1.substream_groups[j].d.v1.substreams;
delete[] m_PresentationV1[pres_idx].d.v1.substream_groups;
delete[] m_PresentationV1[pres_idx].d.v1.substream_group_indexs;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/C++/Core/Ap4Dac4Atom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ AP4_Dac4Atom::Ac4Dsi::SubStream::ParseSubstreamIdxInfo(AP4_BitReader &bits, unsi
{
if (b_substreams_present == 1) {
if (bits.ReadBits(2) == 3) { // substream_index
ss_idx = AP4_Ac4VariableBits(bits, 2);
AP4_Ac4VariableBits(bits, 2);
}
}
return AP4_SUCCESS;
Expand Down
1 change: 0 additions & 1 deletion Source/C++/Core/Ap4Dac4Atom.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ class AP4_Dac4Atom : public AP4_Atom
AP4_UI08 b_substream_contains_bed_objects;
AP4_UI08 b_substream_contains_dynamic_objects;
AP4_UI08 b_substream_contains_ISF_objects;
AP4_UI08 ss_idx;

// methods
AP4_Result ParseSubstreamInfoChan(AP4_BitReader &bits,
Expand Down

0 comments on commit 88361d8

Please sign in to comment.