From b0714d6d8608742be840b033f98b8e4ed53ad1f0 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..1bbb67d6 100644 --- a/src/EbmlBinary.cpp +++ b/src/EbmlBinary.cpp @@ -74,7 +74,8 @@ filepos_t EbmlBinary::ReadData(IOCallback & input, ScopeMode ReadFully) if (Data == nullptr) throw CRTError(std::string("Error allocating data")); SetValueIsSet(); - return input.read(Data, GetSize()); + input.readFully(Data, GetSize()); + return GetSize(); } bool EbmlBinary::operator==(const EbmlBinary & ElementToCompare) const