diff --git a/ebml/EbmlElement.h b/ebml/EbmlElement.h index 06fa39b..62ed7c5 100644 --- a/ebml/EbmlElement.h +++ b/ebml/EbmlElement.h @@ -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 diff --git a/src/EbmlVoid.cpp b/src/EbmlVoid.cpp index 28564bf..60354d1 100644 --- a/src/EbmlVoid.cpp +++ b/src/EbmlVoid.cpp @@ -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();