use length from stream dictionary if directly available

when brute forcing we use the length available in the stream's dictionary token if it is a direct number rather than an indirect reference.
This commit is contained in:
Eliot Jones
2020-02-27 17:17:49 +00:00
parent 420daaac6e
commit ec9e425712

View File

@@ -233,6 +233,11 @@
// Get the expected length from the stream dictionary if present.
long? length = getLength ? GetStreamLength(streamDictionaryToken) : default(long?);
if (!getLength && streamDictionaryToken.TryGet(NameToken.Length, out NumericToken inlineLengthToken))
{
length = inlineLengthToken.Long;
}
// Verify again that we start with "stream"
var hasStartStreamToken = ReadStreamTokenStart(inputBytes, startStreamTokenOffset);