v1: introduce INVALID_FILEPOS_T to return error values when trying to read/write (only in EbmlVoid::ReplaceWidth for now)
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@121 a6f86f6d-0131-4f8e-9e7b-e335508773d5
This commit is contained in:
parent
8bff224319
commit
be6a37df06
@ -238,6 +238,10 @@ extern const EbmlSemanticContext Context_EbmlGlobal;
|
||||
#define EBML_CTX_IDX_INFO(c,i) (c).MyTable[(i)].GetCallbacks
|
||||
#endif
|
||||
|
||||
#if !defined(INVALID_FILEPOS_T)
|
||||
#define INVALID_FILEPOS_T 0
|
||||
#endif
|
||||
|
||||
#define EBML_DEF_CONS
|
||||
#define EBML_DEF_SEP
|
||||
#define EBML_DEF_PARAM
|
||||
|
@ -65,11 +65,11 @@ uint64 EbmlVoid::ReplaceWith(EbmlElement & EltToReplaceWith, IOCallback & output
|
||||
EltToReplaceWith.UpdateSize(bKeepIntact);
|
||||
if (HeadSize() + GetSize() < EltToReplaceWith.GetSize() + EltToReplaceWith.HeadSize()) {
|
||||
// the element can't be written here !
|
||||
return 0;
|
||||
return INVALID_FILEPOS_T;
|
||||
}
|
||||
if (HeadSize() + GetSize() - EltToReplaceWith.GetSize() - EltToReplaceWith.HeadSize() == 1) {
|
||||
// there is not enough space to put a filling element
|
||||
return 0;
|
||||
return INVALID_FILEPOS_T;
|
||||
}
|
||||
|
||||
uint64 CurrentPosition = output.getFilePointer();
|
||||
|
Loading…
x
Reference in New Issue
Block a user