mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-09-19 02:37:56 +08:00
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:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user