Skip to content

Commit

Permalink
Set Box Definition Defaults in Header
Browse files Browse the repository at this point in the history
To ensure that every variable in a box is explicitly set
every variable has been assigned a default in the header.

Change-Id: Iaa806c4058ac6621a64363a00040fbd9903c6710
  • Loading branch information
vaage committed Jun 4, 2018
1 parent 47f2003 commit cc1d4b7
Show file tree
Hide file tree
Showing 4 changed files with 334 additions and 336 deletions.
4 changes: 2 additions & 2 deletions packager/media/formats/mp4/box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ bool Box::ReadWriteHeaderInternal(BoxBuffer* buffer) {
return true;
}

FullBox::FullBox() : version(0), flags(0) {}
FullBox::~FullBox() {}
FullBox::FullBox() = default;
FullBox::~FullBox() = default;

uint32_t FullBox::HeaderSize() const {
// Additional 1-byte version and 3-byte flags.
Expand Down
4 changes: 2 additions & 2 deletions packager/media/formats/mp4/box.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ struct FullBox : Box {

uint32_t HeaderSize() const final;

uint8_t version;
uint32_t flags;
uint8_t version = 0;
uint32_t flags = 0;

protected:
bool ReadWriteHeaderInternal(BoxBuffer* buffer) final;
Expand Down
Loading

0 comments on commit cc1d4b7

Please sign in to comment.