]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
Handle zero page job in Rastertopdf 189/head
authorJaiLuthra1 <luthrajaiji@gmail.com>
Wed, 15 Jan 2020 08:22:05 +0000 (13:52 +0530)
committerJaiLuthra1 <luthrajaiji@gmail.com>
Wed, 15 Jan 2020 08:22:05 +0000 (13:52 +0530)
filter/rastertopdf.cpp

index 7b96b41707aa92731e5856d8302da3c12090a0ba..6f8550572494a597dbdeb50b3297ce4a5a592e15 100644 (file)
@@ -1404,6 +1404,16 @@ int main(int argc, char **argv)
     if (create_pdf_file(&pdf, outformat) != 0)
       die("Unable to create PDF file");
 
+    struct stat buf;
+    fstat(fd, &buf);
+    int size = buf.st_size;
+    if(size <= 4)
+    {
+      close_pdf_file(&pdf);
+      cupsRasterClose(ras);
+      return 0;
+    }
+
     /* Get PCLm attributes from PPD */
     if (ppd && outformat == OUTPUT_FORMAT_PCLM)
     {