Merge pull request #11847 from Snuffleupagus/move-maybeValidDimensions

Move the `maybeValidDimensions` check, used with JPEG images, to occur earlier (PR 11523 follow-up)
This commit is contained in:
Tim van der Meij 2020-04-26 13:39:33 +02:00 committed by GitHub
commit bf416db23d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -549,13 +549,13 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
!softMask && !softMask &&
!mask && !mask &&
image instanceof JpegStream && image instanceof JpegStream &&
image.maybeValidDimensions &&
NativeImageDecoder.isSupported( NativeImageDecoder.isSupported(
image, image,
this.xref, this.xref,
resources, resources,
this.pdfFunctionFactory this.pdfFunctionFactory
) && )
image.maybeValidDimensions
) { ) {
// These JPEGs don't need any more processing so we can just send it. // These JPEGs don't need any more processing so we can just send it.
return this.handler return this.handler

View File

@ -36,13 +36,13 @@ class NativeImageDecoder {
canDecode(image) { canDecode(image) {
return ( return (
image instanceof JpegStream && image instanceof JpegStream &&
image.maybeValidDimensions &&
NativeImageDecoder.isDecodable( NativeImageDecoder.isDecodable(
image, image,
this.xref, this.xref,
this.resources, this.resources,
this.pdfFunctionFactory this.pdfFunctionFactory
) && )
image.maybeValidDimensions
); );
} }