Skip to content

Commit

Permalink
Only when MetaData is read from Keys it should be valid othwise we do…
Browse files Browse the repository at this point in the history
… a best effort as we don't implement the full set.
  • Loading branch information
stefanlenselink committed Apr 5, 2024
1 parent a9dbdf1 commit e5664b0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions MetadataExtractor/Formats/QuickTime/QuickTimeMetadataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

Expand Down Expand Up @@ -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}\"");
}
}
}

Expand All @@ -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)
Expand Down

0 comments on commit e5664b0

Please sign in to comment.