From 849a8e6cac48c5f2e7a54f643751ad2d8a90d366 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 8c801358..c386a6a1 100644 --- a/src/EbmlBinary.cpp +++ b/src/EbmlBinary.cpp @@ -73,8 +73,9 @@ filepos_t EbmlBinary::ReadData(IOCallback & input, ScopeMode ReadFully) Data = (GetSize() < SIZE_MAX) ? static_cast(malloc(GetSize())) : nullptr; if (Data == nullptr) throw CRTError(std::string("Error allocating data")); + input.readFully(Data, GetSize()); SetValueIsSet(); - return input.read(Data, GetSize()); + return GetSize(); } bool EbmlBinary::operator==(const EbmlBinary & ElementToCompare) const