Closed xantari closed 6 years ago
I've changed this in https://github.com/neilharvey/FileSignatures/commit/ff0cf2660cba3cb677c0ebfe918798a9ca8b077e so that it will return a null value when the passed stream is empty (which is the same behaviour as an unrecognised file format).
This is fixed in v2.0, which will be available on Nuget shortly.
When calling: var format = inspector.DetermineFileFormat(ms);
With a MemoryStream that is empty will cause the following error:
System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'
Looks like it is missing bounds checking...