]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/ppd-cache.c
Merge changes from CUPS 1.6svn-r10390.
[thirdparty/cups.git] / cups / ppd-cache.c
index cf34a00bd5dff9c2367701272d78eab656014f2f..d39bf14e5b2cd5ef8b87e7301c0643f8b03f1167 100644 (file)
@@ -753,12 +753,15 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd)   /* I - PPD file */
     }
 
    /*
-    * If we have a similar paper with non-zero margins then we only
-    * want to keep it if it has a larger imageable area length.
+    * If we have a similar paper with non-zero margins then we only want to
+    * keep it if it has a larger imageable area length.  The NULL check is for
+    * dimensions that are <= 0...
     */
 
-    pwg_media      = _pwgMediaForSize(_PWG_FROMPTS(ppd_size->width),
-                                      _PWG_FROMPTS(ppd_size->length));
+    if ((pwg_media = _pwgMediaForSize(_PWG_FROMPTS(ppd_size->width),
+                                      _PWG_FROMPTS(ppd_size->length))) == NULL)
+      continue;
+
     new_width      = pwg_media->width;
     new_length     = pwg_media->length;
     new_left       = _PWG_FROMPTS(ppd_size->left);