You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appearsfile works by matching 1a45 dfa3 at the beginning, then searching for the pattern \x42\x82.matroska (in regex syntax) anywhere in the first 4K.
4K seems very large. My understanding of the spec is that Matroska files must start with an EBML document, which must start with a header, which must contain their docType (matroska). The header can only be so big, so I think searching within the first ~256 bytes is fair.
Demo:
Code
The current code detects two byte patterns. This file doesn't contain the first one:
And does contain the second one, but at a different offset (24-31 instead of 31-38):
The text was updated successfully, but these errors were encountered: