From 3adc27669e0030362fde82bc6675330bc65c4f9a Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Fri, 6 Nov 2026 11:59:12 +0100 Subject: [PATCH] EbmlBinary: use readFully() to read the data We don't support truncated reading of elements. And it was the last class not to use readFully(). 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