We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ede6709 commit 2fdab9bCopy full SHA for 2fdab9b
libvips/foreign/pdfiumload.c
@@ -481,6 +481,17 @@ vips_foreign_load_pdf_header( VipsForeignLoad *load )
481
pdf->pages[i].height = VIPS_RINT(
482
FPDF_GetPageHeight( pdf->page ) * pdf->scale );
483
484
+ /* PDFium allows page width or height to be less than 1 (!!).
485
+ */
486
+ if( pdf->pages[i].width < 1 ||
487
+ pdf->pages[i].height < 1 ||
488
+ pdf->pages[i].width > VIPS_MAX_COORD ||
489
+ pdf->pages[i].height > VIPS_MAX_COORD ) {
490
+ vips_error( class->nickname,
491
+ "%s", _( "page size out of range" ) );
492
+ return( -1 );
493
+ }
494
+
495
if( pdf->pages[i].width > pdf->image.width )
496
pdf->image.width = pdf->pages[i].width;
497
pdf->image.height += pdf->pages[i].height;
0 commit comments