]> granicus.if.org Git - libmatroska/commitdiff
use a safer type cast rather than setting the internal values directly
authorSteve Lhomme <slhomme@matroska.org>
Mon, 15 Mar 2010 15:56:05 +0000 (15:56 +0000)
committerSteve Lhomme <slhomme@matroska.org>
Mon, 15 Mar 2010 15:56:05 +0000 (15:56 +0000)
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libmatroska@7 a6f86f6d-0131-4f8e-9e7b-e335508773d5

matroska/KaxBlockData.h
src/KaxBlockData.cpp

index b8749a986b7a0f036af2a92b1848204e16a5b1af..fc12312303d705a3d229a0b3287331204d006cc4 100644 (file)
@@ -83,7 +83,7 @@ class MATROSKA_DLL_API KaxReferenceBlock : public EbmlSInteger {
        protected:
                const KaxBlockBlob * RefdBlock;
                const KaxBlockGroup * ParentBlock;
-               void SetReferencedTimecode(int64 refTimecode) {Value = refTimecode; bTimecodeSet = true; bValueIsSet = true;};
+               void SetReferencedTimecode(int64 refTimecode) {*static_cast<EbmlSInteger*>(this) = refTimecode; bTimecodeSet = true;};
                bool bTimecodeSet;
 };
 
index b204f27dbae9382700fcc7369daf66c46e3c5486..1c5b9791e34d827a496fefba722240c267ffadcb 100644 (file)
@@ -114,7 +114,7 @@ uint64 KaxReferenceBlock::UpdateSize(bool bSaveDefault, bool bForceRender)
                assert(ParentBlock != NULL);
 
                const KaxInternalBlock &block = *RefdBlock;
-               Value = (int64(block.GlobalTimecode()) - int64(ParentBlock->GlobalTimecode())) / int64(ParentBlock->GlobalTimecodeScale());
+               *static_cast<EbmlSInteger*>(this) = (int64(block.GlobalTimecode()) - int64(ParentBlock->GlobalTimecode())) / int64(ParentBlock->GlobalTimecodeScale());
        }
        return EbmlSInteger::UpdateSize(bSaveDefault, bForceRender);
 }