Skip to content

Commit

Permalink
test6: disable code with bogus Block ownership
Browse files Browse the repository at this point in the history
Both the Cluster and the reference handler think they own the block.

(cherry picked from commit 49f0e33)
  • Loading branch information
robUx4 committed Feb 18, 2024
1 parent 83a6ef6 commit 1fe9216
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/mux/test6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ int main(int argc, char **argv)
KaxBlockBlob *Blob2 = new KaxBlockBlob(BLOCK_BLOB_NO_SIMPLE);
Blob2->SetBlockGroup(*MyNewBlock);
AllCues.AddBlockBlob(*Blob2);

#if 0 // bogus ownership
// frame with a past reference
DataBuffer *data4 = new DataBuffer((binary *)"tttyyy", countof("tttyyy"));
Clust1.AddFrame(MyTrack1, 300 * TIMECODE_SCALE, *data4, MyNewBlock, *MyLastBlockTrk1);
Expand All @@ -272,7 +272,7 @@ int main(int argc, char **argv)
Blob3->SetBlockGroup(*MyLastBlockTrk1);
AllCues.AddBlockBlob(*Blob3);
//AllCues.UpdateSize();

#endif
// simulate the writing of the stream :
// - write an empty element with enough size for the cue entry
// - write the cluster(s)
Expand All @@ -288,7 +288,11 @@ int main(int argc, char **argv)
Clust2.EnableChecksum();

DataBuffer *data2 = new DataBuffer((binary *)"tttyyy", countof("tttyyy"));
#if 0 // bogus ownership
Clust2.AddFrame(MyTrack1, 350 * TIMECODE_SCALE, *data2, MyNewBlock, *MyLastBlockTrk1);
#else
Clust2.AddFrame(MyTrack1, 350 * TIMECODE_SCALE, *data2, MyNewBlock);
#endif

KaxBlockBlob *Blob4 = new KaxBlockBlob(BLOCK_BLOB_NO_SIMPLE);
Blob4->SetBlockGroup(*MyNewBlock);
Expand Down Expand Up @@ -381,10 +385,12 @@ int main(int argc, char **argv)
#endif // OLD
out_file.close();

#if 0 // bogus ownership
delete Blob1;
delete Blob2;
delete Blob3;
delete Blob4;
#endif
}
catch (exception & Ex)
{
Expand Down

0 comments on commit 1fe9216

Please sign in to comment.