Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the element size check in EbmlCallbacks #273

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ebml/EbmlBinary.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class EBML_DLL_API EbmlBinary : public EbmlElement {
EbmlBinary& operator=(const EbmlBinary & ElementToClone);
~EbmlBinary() override;

bool SizeIsValid(std::uint64_t size) const override {return size < 0x7FFFFFFF;} // we don't mind about what's inside
static inline bool SizeIsValid(std::uint64_t size) {return size < 0x7FFFFFFF;} // we don't mind about what's inside

filepos_t RenderData(IOCallback & output, bool bForceRender, const ShouldWrite & writeFilter = WriteSkipDefault) override;
filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;
Expand Down
7 changes: 6 additions & 1 deletion ebml/EbmlCrc32.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace libebml {

DECLARE_EBML_BINARY_LENGTH(EbmlCrc32, 4)
DECLARE_EBML_BINARY(EbmlCrc32)
public:
filepos_t RenderData(IOCallback & output, bool bForceRender, const ShouldWrite & writeFilter = WriteSkipDefault) override;
filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;
Expand Down Expand Up @@ -55,6 +55,11 @@ DECLARE_EBML_BINARY_LENGTH(EbmlCrc32, 4)
std::uint32_t m_crc;
std::uint32_t m_crc_final{0};

static inline bool ValidateSize(std::uint64_t Size)
{
return Size == 4;
}

EBML_CONCRETE_CLASS(EbmlCrc32)
};

Expand Down
2 changes: 1 addition & 1 deletion ebml/EbmlDate.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class EBML_DLL_API EbmlDate : public EbmlElementDefaultSameStorage<std::int64_t>
std::int64_t GetEpochDate() const {return EbmlToEpoch(EbmlElementDefaultSameStorage<std::int64_t>::GetValue());}
std::int64_t GetValue() const {return GetEpochDate();}

bool SizeIsValid(std::uint64_t size) const override {return size == 8 || size == 0;}
static inline bool SizeIsValid(std::uint64_t size) {return size == 8 || size == 0;}

/*!
\note no Default date handled
Expand Down
88 changes: 38 additions & 50 deletions ebml/EbmlElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,71 +77,71 @@ class EbmlElement;
static constexpr const libebml::EbmlId Id_##x {id}; static_assert(libebml::EbmlId::IsValid(Id_##x .GetValue()), "invalid id for " name ); \
static constexpr const libebml::EbmlSemanticContext Context_##x = libebml::EbmlSemanticContext( &parent::SemanticContext, global, &EBML_INFO(x));

#define DEFINE_xxx_CLASS_BASE(x,BaseClass,id,parent,name,versions,global) \
#define DEFINE_xxx_CLASS_BASE(x,BaseClass,id,parent,name,valid,versions,global) \
DEFINE_xxx_CLASS_CONS(x,id,parent,name,global) \
constexpr const libebml::EbmlCallbacks x::ClassInfos(x::Create, Id_##x, false, false, name, Context_##x, versions); \
constexpr const libebml::EbmlCallbacks x::ClassInfos(x::Create, Id_##x, false, false, name, Context_##x, versions, valid); \
x::x() : BaseClass(x::ClassInfos) {}

#define DEFINE_xxx_CLASS_BASE_DEFAULT(x,BaseClass,id,parent,name,global,StorageType,defval,versions) \
#define DEFINE_xxx_CLASS_BASE_DEFAULT(x,BaseClass,id,parent,name,global,StorageType,defval,valid,versions) \
DEFINE_xxx_CLASS_CONS(x,id,parent,name,global) \
constexpr const libebml::EbmlCallbacksWithDefault<StorageType> x::ClassInfos(x::Create, Id_##x, defval, name, Context_##x, versions); \
constexpr const libebml::EbmlCallbacksWithDefault<StorageType> x::ClassInfos(x::Create, Id_##x, defval, name, Context_##x, versions, valid); \
x::x() : BaseClass(x::ClassInfos) {}

#define DEFINE_xxx_CLASS_BASE_NODEFAULT(x,BaseClass,id,parent,name,global,StorageType,versions) \
#define DEFINE_xxx_CLASS_BASE_NODEFAULT(x,BaseClass,id,parent,name,global,StorageType,valid,versions) \
DEFINE_xxx_CLASS_CONS(x,id,parent,name,global) \
constexpr const libebml::EbmlCallbacksDefault<StorageType> x::ClassInfos(x::Create, Id_##x, name, Context_##x, versions); \
constexpr const libebml::EbmlCallbacksDefault<StorageType> x::ClassInfos(x::Create, Id_##x, name, Context_##x, versions, valid); \
x::x() : BaseClass(x::ClassInfos) {}

#define DEFINE_xxx_UINTEGER(x,id,parent,name,versions,global) \
DEFINE_xxx_CLASS_BASE_NODEFAULT(x,EbmlUInteger,id,parent,name,global,std::uint64_t,versions)
DEFINE_xxx_CLASS_BASE_NODEFAULT(x,EbmlUInteger,id,parent,name,global,std::uint64_t, libebml::EbmlUInteger::SizeIsValid, versions)

#define DEFINE_xxx_SINTEGER(x,id,parent,name,versions,global) \
DEFINE_xxx_CLASS_BASE_NODEFAULT(x,EbmlSInteger,id,parent,name,global,std::int64_t,versions)
DEFINE_xxx_CLASS_BASE_NODEFAULT(x,EbmlSInteger,id,parent,name,global,std::int64_t, libebml::EbmlSInteger::SizeIsValid, versions)

#define DEFINE_xxx_STRING(x,id,parent,name,versions,global) \
DEFINE_xxx_CLASS_BASE_NODEFAULT(x,EbmlString,id,parent,name,global,const char *,versions)
DEFINE_xxx_CLASS_BASE_NODEFAULT(x,EbmlString,id,parent,name,global,const char *, libebml::EbmlString::SizeIsValid, versions)

#define DEFINE_xxx_UNISTRING(x,id,parent,name,versions,global) \
DEFINE_xxx_CLASS_BASE_NODEFAULT(x,EbmlUnicodeString,id,parent,name,global, const wchar_t *,versions)
DEFINE_xxx_CLASS_BASE_NODEFAULT(x,EbmlUnicodeString,id,parent,name,global, const wchar_t *, libebml::EbmlUnicodeString::SizeIsValid, versions)

#define DEFINE_xxx_FLOAT(x,id,parent,name,versions,global) \
DEFINE_xxx_CLASS_BASE_NODEFAULT(x,EbmlFloat,id,parent,name,global,double,versions)
DEFINE_xxx_CLASS_BASE_NODEFAULT(x,EbmlFloat,id,parent,name,global,double, libebml::EbmlFloat::SizeIsValid, versions)

#define DEFINE_xxx_DATE(x,id,parent,name,versions,global) \
DEFINE_xxx_CLASS_BASE_NODEFAULT(x,EbmlDate,id,parent,name,global,std::int64_t,versions)
DEFINE_xxx_CLASS_BASE_NODEFAULT(x,EbmlDate,id,parent,name,global,std::int64_t, libebml::EbmlDate::SizeIsValid, versions)

#define DEFINE_xxx_BINARY(x,id,parent,name,versions,global) \
DEFINE_xxx_CLASS_BASE(x,EbmlBinary,id,parent,name,versions,global)
#define DEFINE_xxx_BINARY(x,id,parent,name,valid,versions,global) \
DEFINE_xxx_CLASS_BASE(x,EbmlBinary,id,parent,name,valid,versions,global)

#define DEFINE_xxx_UINTEGER_DEF(x,id,parent,name,versions,global,defval) \
DEFINE_xxx_CLASS_BASE_DEFAULT(x,EbmlUInteger,id,parent,name,global,std::uint64_t,defval, versions)
DEFINE_xxx_CLASS_BASE_DEFAULT(x,EbmlUInteger,id,parent,name,global,std::uint64_t,defval, libebml::EbmlUInteger::SizeIsValid, versions)

#define DEFINE_xxx_SINTEGER_DEF(x,id,parent,name,versions,global,defval) \
DEFINE_xxx_CLASS_BASE_DEFAULT(x,EbmlSInteger,id,parent,name,global,std::int64_t,defval, versions)
DEFINE_xxx_CLASS_BASE_DEFAULT(x,EbmlSInteger,id,parent,name,global,std::int64_t,defval, libebml::EbmlSInteger::SizeIsValid, versions)

#define DEFINE_xxx_STRING_DEF(x,id,parent,name,versions,global,defval) \
DEFINE_xxx_CLASS_BASE_DEFAULT(x,EbmlString,id,parent,name,global,const char *,defval, versions)
DEFINE_xxx_CLASS_BASE_DEFAULT(x,EbmlString,id,parent,name,global,const char *,defval, libebml::EbmlString::SizeIsValid, versions)

#define DEFINE_xxx_UNISTRING_DEF(x,id,parent,name,versions,global,defval) \
DEFINE_xxx_CLASS_BASE_DEFAULT(x,EbmlUnicodeString,id,parent,name,global,const wchar_t*,defval, versions)
DEFINE_xxx_CLASS_BASE_DEFAULT(x,EbmlUnicodeString,id,parent,name,global,const wchar_t*,defval, libebml::EbmlUnicodeString::SizeIsValid, versions)

#define DEFINE_xxx_FLOAT_DEF(x,id,parent,name,versions,global,defval) \
DEFINE_xxx_CLASS_BASE_DEFAULT(x,EbmlFloat,id,parent,name,global,double,defval, versions)
DEFINE_xxx_CLASS_BASE_DEFAULT(x,EbmlFloat,id,parent,name,global,double,defval, libebml::EbmlFloat::SizeIsValid, versions)

#define DEFINE_xxx_DATE_DEF(x,id,parent,name,versions,global,defval) \
DEFINE_xxx_CLASS_BASE_DEFAULT(x,EbmlDate,id,parent,name,versions,global,defval, versions)
DEFINE_xxx_CLASS_BASE_DEFAULT(x,EbmlDate,id,parent,name,versions,global,defval, libebml::EbmlDate::SizeIsValid, versions)

// define a class with no parent class (can be used globally)
#define DEFINE_xxx_CLASS_ORPHAN(x,id,name,versions,global) \
#define DEFINE_xxx_CLASS_ORPHAN(x,id,name,valid,versions,global) \
static constexpr const libebml::EbmlId Id_##x {id}; static_assert(libebml::EbmlId::IsValid(Id_##x .GetValue()), "invalid id for " name ); \
static constexpr const libebml::EbmlSemanticContext Context_##x = libebml::EbmlSemanticContext(nullptr, global, nullptr); \
constexpr const libebml::EbmlCallbacks x::ClassInfos(x::Create, Id_##x, false, false, name, Context_##x, versions); \
constexpr const libebml::EbmlCallbacks x::ClassInfos(x::Create, Id_##x, false, false, name, Context_##x, versions, valid); \

#define DEFINE_EBML_CONTEXT(x) DEFINE_xxx_CONTEXT(x,GetEbmlGlobal_Context)

#define DEFINE_EBML_MASTER(x,id,parent,infinite,name,versions) DEFINE_xxx_MASTER(x,id,parent,infinite,name,versions,GetEbmlGlobal_Context)
#define DEFINE_EBML_MASTER_ORPHAN(x,id,infinite,name,versions) DEFINE_xxx_MASTER_ORPHAN(x,id,infinite,name,versions,GetEbmlGlobal_Context)
#define DEFINE_EBML_CLASS_ORPHAN(x,id,name,versions) DEFINE_xxx_CLASS_ORPHAN(x,id,name,versions,GetEbmlGlobal_Context)
#define DEFINE_EBML_CLASS_ORPHAN(x,id,name,valid,versions) DEFINE_xxx_CLASS_ORPHAN(x,id,name,valid,versions,GetEbmlGlobal_Context)
#define DEFINE_EBML_UINTEGER_DEF(x,id,parent,name,val,versions) DEFINE_xxx_UINTEGER_DEF(x,id,parent,name,versions,GetEbmlGlobal_Context,val)
#define DEFINE_EBML_STRING_DEF(x,id,parent,name,val,versions) DEFINE_xxx_STRING_DEF(x,id,parent,name,versions,GetEbmlGlobal_Context,val)

Expand Down Expand Up @@ -199,10 +199,6 @@ class DllApi x : public BaseClass { \
#define DECLARE_xxx_BINARY(x,DllApi) \
DECLARE_xxx_BASE(x, DllApi, libebml::EbmlBinary)

#define DECLARE_xxx_BINARY_LENGTH(x,len,DllApi) \
DECLARE_xxx_BASE(x, DllApi, libebml::EbmlBinary) \
bool SizeIsValid(std::uint64_t size) const override {return size == len;}

#define DECLARE_xxx_UINTEGER(x,DllApi) \
DECLARE_xxx_BASE_NODEFAULT(x, DllApi, libebml::EbmlUInteger, std::uint64_t)

Expand Down Expand Up @@ -243,7 +239,6 @@ class DllApi x : public BaseClass { \
#define DECLARE_EBML_UINTEGER_DEF(x) DECLARE_xxx_UINTEGER_DEF(x,EBML_DLL_API)
#define DECLARE_EBML_STRING_DEF(x) DECLARE_xxx_STRING_DEF( x,EBML_DLL_API)
#define DECLARE_EBML_BINARY(x) DECLARE_xxx_BINARY( x,EBML_DLL_API)
#define DECLARE_EBML_BINARY_LENGTH(x,len) DECLARE_xxx_BINARY_LENGTH(x,len,EBML_DLL_API)

#define EBML_CONCRETE_CLASS(Type) \
public: \
Expand Down Expand Up @@ -339,16 +334,18 @@ class EBML_DLL_API EbmlDocVersion {
class EBML_DLL_API EbmlCallbacks {
public:
using CreateOperator = EbmlElement & (*)(void);
using SizeValidator = bool (*)(std::uint64_t);

constexpr EbmlCallbacks(const CreateOperator & Creator, const EbmlId & aGlobalId, bool aCanInfinite, bool aHasDefault, const char * aDebugName, const EbmlSemanticContext & aContext,
const EbmlDocVersion & aVersion)
const EbmlDocVersion & aVersion, const SizeValidator & aSizeCheck)
:Create(Creator)
,GlobalId(aGlobalId)
,CanInfinite(aCanInfinite)
,hasDefault(aHasDefault)
,Version(aVersion)
,DebugName(aDebugName)
,Context(aContext)
,SizeCheck(aSizeCheck)
{
}

Expand All @@ -361,6 +358,11 @@ class EBML_DLL_API EbmlCallbacks {
inline constexpr bool HasDefault() const { return hasDefault; }
// get information about supported version for this element
inline constexpr const EbmlDocVersion & GetVersions() const { return Version; }
inline constexpr bool IsSizeValid(std::uint64_t size, bool AsInfinite) const {
if (AsInfinite)
return CanHaveInfiniteSize();
return SizeCheck(size);
}

private:
const CreateOperator Create;
Expand All @@ -370,14 +372,15 @@ class EBML_DLL_API EbmlCallbacks {
const EbmlDocVersion &Version;
const char * DebugName;
const EbmlSemanticContext & Context;
const SizeValidator SizeCheck;
};

template<typename T>
class EBML_DLL_API EbmlCallbacksDefault : public EbmlCallbacks {
public:
constexpr EbmlCallbacksDefault(EbmlElement & (*Creator)(), const EbmlId & aGlobalId, const char * aDebugName, const EbmlSemanticContext & aContext,
const EbmlDocVersion & aVersion, bool aHasDefault = false)
:EbmlCallbacks(Creator, aGlobalId, false, aHasDefault, aDebugName, aContext, aVersion)
const EbmlDocVersion & aVersion, const SizeValidator & aValid, bool aHasDefault = false)
:EbmlCallbacks(Creator, aGlobalId, false, aHasDefault, aDebugName, aContext, aVersion, aValid)
{
}
};
Expand All @@ -386,8 +389,8 @@ template<typename T>
class EBML_DLL_API EbmlCallbacksWithDefault : public EbmlCallbacksDefault<T> {
public:
constexpr EbmlCallbacksWithDefault(EbmlElement & (*Creator)(), const EbmlId & aGlobalId, const T &def, const char * aDebugName, const EbmlSemanticContext & aContext,
const EbmlDocVersion & aVersion)
:EbmlCallbacksDefault<T>(Creator, aGlobalId, aDebugName, aContext, aVersion, true)
const EbmlDocVersion & aVersion, const EbmlCallbacks::SizeValidator & aValid)
:EbmlCallbacksDefault<T>(Creator, aGlobalId, aDebugName, aContext, aVersion, aValid, true)
,defaultValue(def)
{
}
Expand Down Expand Up @@ -537,20 +540,6 @@ static inline const EbmlSemantic & tEBML_CTX_IDX(const EbmlSemanticContextMaster
return c.GetSemantic(i);
}

class EBML_DLL_API EbmlCallbacksMaster : public EbmlCallbacks {
public:
constexpr EbmlCallbacksMaster(EbmlElement & (*Creator)(), const EbmlId & aGlobalId, bool aCanInfinite,
const char * aDebugName, const EbmlSemanticContextMaster & aContext,
const EbmlDocVersion & aVersion)
:EbmlCallbacks(Creator, aGlobalId, aCanInfinite, false, aDebugName, aContext, aVersion)
{
}

inline constexpr const EbmlSemanticContextMaster & GetContextMaster() const {
return static_cast<const EbmlSemanticContextMaster &>(GetContext());
}
};

/*!
\class EbmlElement
\brief Hold basic informations about an EBML element (ID + length)
Expand Down Expand Up @@ -619,8 +608,7 @@ class EBML_DLL_API EbmlElement {
return false;
}

virtual bool SizeIsValid(std::uint64_t) const = 0;
bool ValidateSize() const { return SizeIsValid(GetSize()); }
bool ValidateSize() const { return ElementSpec().IsSizeValid(GetSize(), !IsFiniteSize()); }

std::uint64_t GetElementPosition() const {
return ElementPosition;
Expand Down Expand Up @@ -688,7 +676,7 @@ class EBML_DLL_API EbmlElement {
\return a DummyRawElement if the element is unknown or nullptr if the element dummy is not allowed
*/
static EbmlElement *CreateElementUsingContext(const EbmlId & aID, const EbmlSemanticContext & Context, int & LowLevel, bool IsGlobalContext,
bool AsInfiniteSize,
std::uint64_t WithSize, bool AsInfiniteSize,
bool bAllowDummy = false, unsigned int MaxLowerLevel = 1);

filepos_t RenderHead(IOCallback & output, bool bForceRender, const ShouldWrite& writeFilter = WriteSkipDefault, bool bKeepPosition = false);
Expand Down
2 changes: 1 addition & 1 deletion ebml/EbmlFloat.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class EBML_DLL_API EbmlFloat : public EbmlElementDefaultSameStorage<double> {

EbmlFloat(const EbmlCallbacksDefault<double> &, Precision prec = FLOAT_32);

bool SizeIsValid(std::uint64_t size) const override
static inline bool SizeIsValid(std::uint64_t size)
{
return (size == 4 || size == 8);
}
Expand Down
18 changes: 17 additions & 1 deletion ebml/EbmlMaster.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace libebml {

constexpr const bool bChecksumUsedByDefault = false;

class EbmlCallbacksMaster;

/*!
\class EbmlMaster
\brief Handle all operations on an EBML element that contains other EBML elements
Expand All @@ -31,7 +33,7 @@ class EBML_DLL_API EbmlMaster : public EbmlElement {
explicit EbmlMaster(const EbmlCallbacksMaster &, bool bSizeIsKnown = true);
EbmlMaster(const EbmlMaster & ElementToClone);
EbmlMaster& operator=(const EbmlMaster&) = delete;
bool SizeIsValid(std::uint64_t /*size*/) const override {return true;}
static inline bool SizeIsValid(std::uint64_t /*size*/) {return true;}
/*!
\warning be carefull to clear the memory allocated in the ElementList elsewhere
*/
Expand Down Expand Up @@ -151,6 +153,20 @@ class EBML_DLL_API EbmlMaster : public EbmlElement {
bool ProcessMandatory();
};

class EBML_DLL_API EbmlCallbacksMaster : public EbmlCallbacks {
public:
constexpr EbmlCallbacksMaster(EbmlElement & (*Creator)(), const EbmlId & aGlobalId, bool aCanInfinite,
const char * aDebugName, const EbmlSemanticContextMaster & aContext,
const EbmlDocVersion & aVersion)
:EbmlCallbacks(Creator, aGlobalId, aCanInfinite, false, aDebugName, aContext, aVersion, libebml::EbmlMaster::SizeIsValid)
{
}

inline constexpr const EbmlSemanticContextMaster & GetContextMaster() const {
return static_cast<const EbmlSemanticContextMaster &>(GetContext());
}
};

static inline constexpr const EbmlSemanticContextMaster & tEBML_CONTEXT(const EbmlMaster * e)
{
return e->ContextMaster();
Expand Down
2 changes: 1 addition & 1 deletion ebml/EbmlSInteger.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class EBML_DLL_API EbmlSInteger : public EbmlElementDefaultSameStorage<std::int6
*/
void SetDefaultSize(std::uint64_t nDefaultSize = DEFAULT_INT_SIZE) override {EbmlElement::SetDefaultSize(nDefaultSize); SetSize_(nDefaultSize);}

bool SizeIsValid(std::uint64_t size) const override {return size <= 8;}
static inline bool SizeIsValid(std::uint64_t size) {return size <= 8;}
filepos_t RenderData(IOCallback & output, bool bForceRender, const ShouldWrite & writeFilter = WriteSkipDefault) override;
filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;
filepos_t UpdateSize(const ShouldWrite & writeFilter = WriteSkipDefault, bool bForceRender = false) override;
Expand Down
2 changes: 1 addition & 1 deletion ebml/EbmlString.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class EBML_DLL_API EbmlString : public EbmlElementDefaultStorage<const char *, s
public:
EbmlString(const EbmlCallbacksDefault<const char *> &);

bool SizeIsValid(std::uint64_t size) const override {return size < 0x7FFFFFFF;} // any size is possible
static inline bool SizeIsValid(std::uint64_t size) {return size < 0x7FFFFFFF;} // any size is possible
filepos_t RenderData(IOCallback & output, bool bForceRender, const ShouldWrite & writeFilter = WriteSkipDefault) override;
filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;
filepos_t UpdateSize(const ShouldWrite & writeFilter = WriteSkipDefault, bool bForceRender = false) override;
Expand Down
2 changes: 1 addition & 1 deletion ebml/EbmlUInteger.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class EBML_DLL_API EbmlUInteger : public EbmlElementDefaultSameStorage<std::uint
*/
void SetDefaultSize(std::uint64_t nDefaultSize = DEFAULT_UINT_SIZE) override {EbmlElement::SetDefaultSize(nDefaultSize); SetSize_(nDefaultSize);}

bool SizeIsValid(std::uint64_t size) const override {return size <= 8;}
static inline bool SizeIsValid(std::uint64_t size) {return size <= 8;}
filepos_t RenderData(IOCallback & output, bool bForceRender, const ShouldWrite & writeFilter = WriteSkipDefault) override;
filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;
filepos_t UpdateSize(const ShouldWrite & writeFilter = WriteSkipDefault, bool bForceRender = false) override;
Expand Down
2 changes: 1 addition & 1 deletion ebml/EbmlUnicodeString.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class EBML_DLL_API EbmlUnicodeString : public EbmlElementDefaultStorage<const wc
public:
EbmlUnicodeString(const EbmlCallbacksDefault<const wchar_t *> &);

bool SizeIsValid(std::uint64_t /*size*/) const override {return true;} // any size is possible
static inline bool SizeIsValid(std::uint64_t /*size*/) {return true;} // any size is possible
filepos_t RenderData(IOCallback & output, bool bForceRender, const ShouldWrite & writeFilter = WriteSkipDefault) override;
filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;
filepos_t UpdateSize(const ShouldWrite & writeFilter = WriteSkipDefault, bool bForceRender = false) override;
Expand Down
Loading