Fix an instance reference to a static data member.

This commit is contained in:
Tsuda Kageyu 2015-11-12 14:48:24 +09:00
parent c66e6b27d9
commit ec8e611909

View File

@ -39,15 +39,14 @@ using namespace ID3v2;
class Header::HeaderPrivate
{
public:
HeaderPrivate() : majorVersion(4),
revisionNumber(0),
unsynchronisation(false),
extendedHeader(false),
experimentalIndicator(false),
footerPresent(false),
tagSize(0) {}
~HeaderPrivate() {}
HeaderPrivate() :
majorVersion(4),
revisionNumber(0),
unsynchronisation(false),
extendedHeader(false),
experimentalIndicator(false),
footerPresent(false),
tagSize(0) {}
uint majorVersion;
uint revisionNumber;
@ -58,8 +57,6 @@ public:
bool footerPresent;
uint tagSize;
static const uint size = 10;
};
////////////////////////////////////////////////////////////////////////////////
@ -68,7 +65,7 @@ public:
TagLib::uint Header::size()
{
return HeaderPrivate::size;
return 10;
}
ByteVector Header::fileIdentifier()
@ -80,14 +77,14 @@ ByteVector Header::fileIdentifier()
// public members
////////////////////////////////////////////////////////////////////////////////
Header::Header()
Header::Header() :
d(new HeaderPrivate())
{
d = new HeaderPrivate;
}
Header::Header(const ByteVector &data)
Header::Header(const ByteVector &data) :
d(new HeaderPrivate())
{
d = new HeaderPrivate;
parse(data);
}
@ -139,9 +136,9 @@ TagLib::uint Header::tagSize() const
TagLib::uint Header::completeTagSize() const
{
if(d->footerPresent)
return d->tagSize + d->size + Footer::size();
return d->tagSize + size() + Footer::size();
else
return d->tagSize + d->size;
return d->tagSize + size();
}
void Header::setTagSize(uint s)
@ -199,7 +196,6 @@ void Header::parse(const ByteVector &data)
if(data.size() < size())
return;
// do some sanity checking -- even in ID3v2.3.0 and less the tag size is a
// synch-safe integer, so all bytes must be less than 128. If this is not
// true then this is an invalid tag.