From 108f7fd5fe77414bec2491a6ba1a6855da56e37f Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Mon, 23 Feb 2015 11:27:17 +0100 Subject: [PATCH] do not allow too big String sizes the max value is the same as in EbmlBinary and is still generous --- ebml/EbmlString.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebml/EbmlString.h b/ebml/EbmlString.h index 6938576..c93a3c3 100644 --- a/ebml/EbmlString.h +++ b/ebml/EbmlString.h @@ -55,7 +55,7 @@ class EBML_DLL_API EbmlString : public EbmlElement { virtual ~EbmlString() {} - virtual bool ValidateSize() const {return IsFiniteSize();} // any size is possible + virtual bool ValidateSize() const {return IsFiniteSize() && GetSize() < 0x7FFFFFFF;} // any size is possible filepos_t RenderData(IOCallback & output, bool bForceRender, bool bWithDefault = false); filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA); filepos_t UpdateSize(bool bWithDefault = false, bool bForceRender = false);