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

Fix ID on cloned EbmlDummy and avoid default constructor #182

Merged
merged 2 commits into from
Dec 26, 2023
Merged
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
5 changes: 2 additions & 3 deletions ebml/EbmlDummy.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ namespace libebml {

class EBML_DLL_API EbmlDummy : public EbmlBinary {
public:
EbmlDummy() : EbmlBinary(EbmlDummy::ClassInfos), DummyId(DummyRawId) {}
EbmlDummy(const EbmlId & aId) : EbmlBinary(EbmlDummy::ClassInfos), DummyId(aId) {}

bool IsDummy() const override {return true;}
Expand All @@ -27,9 +26,9 @@ class EBML_DLL_API EbmlDummy : public EbmlBinary {
const EbmlSemanticContext &Context() const override;
const char *DebugName() const override { return "DummyElement"; }
EbmlElement & CreateElement() const override { return Create(); }
EbmlElement * Clone() const override { return &Create(); }
EbmlElement * Clone() const override { return new EbmlDummy(DummyId); }

static EbmlElement & Create() { return *(new EbmlDummy); }
static EbmlElement & Create() { return *(new EbmlDummy(DummyRawId)); }
static const EbmlId & ClassId() { return DummyRawId; };
static const EbmlCallbacks ClassInfos;

Expand Down