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