From 180868f70762adda0ad471ec081d215e25fb3d67 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Sun, 7 Jan 2024 10:38:54 +0100 Subject: [PATCH] don't try to write elements that are deprecated They should not be readable by anyone. --- ebml/EbmlElement.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ebml/EbmlElement.h b/ebml/EbmlElement.h index d25f865c..d95ea365 100644 --- a/ebml/EbmlElement.h +++ b/ebml/EbmlElement.h @@ -425,11 +425,12 @@ class EBML_DLL_API EbmlElement { static bool WriteSkipDefault(const EbmlElement &elt) { if (elt.IsDefaultValue()) return false; - return true; + return elt.ElementSpec().GetVersions().minver == EbmlDocVersion::ANY_VERSION; } - static bool WriteAll(const EbmlElement &) { - return true; + // write all elements except deprecated ones + static bool WriteAll(const EbmlElement & elt) { + return elt.ElementSpec().GetVersions().minver == EbmlDocVersion::ANY_VERSION; } explicit EbmlElement(const EbmlCallbacks &, std::uint64_t aDefaultSize, bool bValueSet = false);