From b91a2effd7b8999fc250f1ed00a1226d47a9ce88 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 8c801358..f4ab468d 100644 --- a/src/EbmlBinary.cpp +++ b/src/EbmlBinary.cpp @@ -79,6 +79,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()))); }