From 44d2a6d2edacb6f7d1b05cf23983fd2e2972f632 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Mon, 15 Mar 2010 15:56:05 +0000 Subject: [PATCH] use a safer type cast rather than setting the internal values directly git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libmatroska@7 a6f86f6d-0131-4f8e-9e7b-e335508773d5 --- matroska/KaxBlockData.h | 2 +- src/KaxBlockData.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/matroska/KaxBlockData.h b/matroska/KaxBlockData.h index b8749a9..fc12312 100644 --- a/matroska/KaxBlockData.h +++ b/matroska/KaxBlockData.h @@ -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(this) = refTimecode; bTimecodeSet = true;}; bool bTimecodeSet; }; diff --git a/src/KaxBlockData.cpp b/src/KaxBlockData.cpp index b204f27..1c5b979 100644 --- a/src/KaxBlockData.cpp +++ b/src/KaxBlockData.cpp @@ -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(this) = (int64(block.GlobalTimecode()) - int64(ParentBlock->GlobalTimecode())) / int64(ParentBlock->GlobalTimecodeScale()); } return EbmlSInteger::UpdateSize(bSaveDefault, bForceRender); } -- 2.40.0