From 051c0c26f1f9ebfded9be97bb9fe35b072e81f17 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 27 Oct 2026 15:03:38 +0100 Subject: [PATCH] EbmlBinary: read the whole data with SCOPE_ALL_DATA IOCallback::read() may not read all the data at once. There is IOCallback::readFully() for that that throws an error if some data are missing. This is also how the other EBML types are reading their full data. Reported-by: Judith Malshini (@JudithMalshini) , Chamod Anuradha (@Chamodanu) Fixes #360 --- src/EbmlBinary.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EbmlBinary.cpp b/src/EbmlBinary.cpp index e653b386..5f267cdb 100644 --- a/src/EbmlBinary.cpp +++ b/src/EbmlBinary.cpp @@ -89,8 +89,9 @@ filepos_t EbmlBinary::ReadData(IOCallback & input, ScopeMode ReadFully) Data = (GetSize() < std::numeric_limits::max()) ? static_cast(malloc(GetSize())) : nullptr; if (Data == nullptr) throw std::runtime_error("Error allocating data"); + input.readFully(Data, GetSize()); SetValueIsSet(); - return input.read(Data, GetSize()); + return GetSize(); } bool EbmlBinary::operator==(const EbmlBinary & ElementToCompare) const