From 7747ececf3c36c41c5450a9e086fd7765e25be3c Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Fri, 2 Apr 2010 17:33:49 +0000 Subject: [PATCH] do not access Data directly git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libmatroska@64 a6f86f6d-0131-4f8e-9e7b-e335508773d5 --- matroska/KaxBlock.h | 2 +- src/KaxBlock.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/matroska/KaxBlock.h b/matroska/KaxBlock.h index 9fc092d..d0f56c3 100644 --- a/matroska/KaxBlock.h +++ b/matroska/KaxBlock.h @@ -355,7 +355,7 @@ class MATROSKA_DLL_API KaxBlockVirtual : public EbmlBinary { public: KaxBlockVirtual() :ParentCluster(NULL) {SetBuffer(DataBlock,sizeof(DataBlock)); SetValueIsSet(false);} KaxBlockVirtual(const KaxBlockVirtual & ElementToClone); - ~KaxBlockVirtual() { if( Data == DataBlock ) SetBuffer( NULL, 0 ); }; + ~KaxBlockVirtual(); bool ValidateSize() const {return true;} /*! diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp index 2965218..08d615b 100644 --- a/src/KaxBlock.cpp +++ b/src/KaxBlock.cpp @@ -303,6 +303,12 @@ KaxBlockVirtual::KaxBlockVirtual(const KaxBlockVirtual & ElementToClone) SetValueIsSet(false); } +KaxBlockVirtual::~KaxBlockVirtual() +{ + if(GetBuffer() == DataBlock) + SetBuffer( NULL, 0 ); +} + filepos_t KaxBlockVirtual::UpdateSize(bool bSaveDefault, bool bForceRender) { assert(TrackNumber < 0x4000); -- 2.40.0