From e5664b063b7be814e4a81da0ff35394e8d764333 Mon Sep 17 00:00:00 2001 From: Stefan Lenselink Date: Fri, 5 Apr 2024 15:57:28 +0200 Subject: [PATCH] Only when MetaData is read from Keys it should be valid othwise we do a best effort as we don't implement the full set. --- .../Formats/QuickTime/QuickTimeMetadataReader.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/MetadataExtractor/Formats/QuickTime/QuickTimeMetadataReader.cs b/MetadataExtractor/Formats/QuickTime/QuickTimeMetadataReader.cs index 26e6a587..c3536a92 100644 --- a/MetadataExtractor/Formats/QuickTime/QuickTimeMetadataReader.cs +++ b/MetadataExtractor/Formats/QuickTime/QuickTimeMetadataReader.cs @@ -198,7 +198,7 @@ void MetaDataHandler(AtomCallbackArgs a) } } - void MetaDataTagHandler(AtomCallbackArgs a, string key) + void MetaDataTagHandler(AtomCallbackArgs a, string key, bool keyShouldBeValid = false) { // Value Atom a.Reader.Skip(8); // uint32 type indicator, uint32 locale indicator @@ -207,7 +207,10 @@ void MetaDataTagHandler(AtomCallbackArgs a, string key) var dataTypeIndicator = a.Reader.GetUInt32(); if (!_supportedAtomValueTypes.Contains((int)dataTypeIndicator)) { - GetMetaHeaderDirectory().AddError($"Unsupported type indicator \"{dataTypeIndicator}\" for key \"{key}\""); + if (keyShouldBeValid) + { + GetMetaHeaderDirectory().AddError($"Unsupported type indicator \"{dataTypeIndicator}\" for key \"{key}\""); + } return; } @@ -242,7 +245,10 @@ void MetaDataTagHandler(AtomCallbackArgs a, string key) } else { - GetMetaHeaderDirectory().AddError($"Unsupported ilst key \"{key}\""); + if (keyShouldBeValid) + { + GetMetaHeaderDirectory().AddError($"Unsupported ilst key \"{key}\""); + } } } @@ -258,7 +264,7 @@ void MetaDataKeysTagsHandler(AtomCallbackArgs a) var key = metaDataKeys[(int)a.Type - 1]; - MetaDataTagHandler(a, key); + MetaDataTagHandler(a, key, true); } void MetaDataItemListTagsHandler(AtomCallbackArgs a)