From 6978e8d8cfc3ef8e36daa1c10c926e73d5665ec7 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Mon, 9 Nov 2026 15:50:09 +0100 Subject: [PATCH] EbmlBinary: do not consider elements equal if their value is not set They can't be equal and we should not compare uninitialized data. --- src/EbmlBinary.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/EbmlBinary.cpp b/src/EbmlBinary.cpp index e653b386..d39b16e1 100644 --- a/src/EbmlBinary.cpp +++ b/src/EbmlBinary.cpp @@ -95,6 +95,8 @@ filepos_t EbmlBinary::ReadData(IOCallback & input, ScopeMode ReadFully) bool EbmlBinary::operator==(const EbmlBinary & ElementToCompare) const { + if (!ValueIsSet() || !ElementToCompare.ValueIsSet()) + return false; return ((GetSize() == ElementToCompare.GetSize()) && (GetSize() == 0 || !memcmp(Data, ElementToCompare.Data, GetSize()))); }