You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
podofo/podofo_CVE-2019-20093.patch

16 lines
924 B

diff -rupN --no-dereference podofo-0.9.7/tools/podofoimgextract/ImageExtractor.cpp podofo-0.9.7-new/tools/podofoimgextract/ImageExtractor.cpp
--- podofo-0.9.7/tools/podofoimgextract/ImageExtractor.cpp 2018-02-25 12:48:38.000000000 +0100
+++ podofo-0.9.7-new/tools/podofoimgextract/ImageExtractor.cpp 2022-01-28 10:14:43.982675433 +0100
@@ -117,6 +117,11 @@ void ImageExtractor::ExtractImage( PdfOb
//long lBitsPerComponent = pObject->GetDictionary().GetKey( PdfName("BitsPerComponent" ) )->GetNumber();
// TODO: Handle colorspaces
+ if ( !pObject->GetDictionary().HasKey( PdfName("Width" ) ) || !pObject->GetDictionary().HasKey( PdfName("Height" ) ) )
+ {
+ PODOFO_RAISE_ERROR( ePdfError_BrokenFile );
+ }
+
// Create a ppm image
const char* pszPpmHeader = "P6\n# Image extracted by PoDoFo\n%" PDF_FORMAT_INT64 " %" PDF_FORMAT_INT64 "\n%li\n";