--- cups/ppd-cache.c~	2012-03-14 14:00:09.141835372 +0100
+++ cups/ppd-cache.c	2012-03-17 15:12:05.974310990 +0100
@@ -755,6 +755,8 @@
 
     pwg_media      = _pwgMediaForSize(_PWG_FROMPTS(ppd_size->width),
                                       _PWG_FROMPTS(ppd_size->length));
+    if (pwg_media == NULL)
+      continue;
     new_width      = pwg_media->width;
     new_length     = pwg_media->length;
     new_left       = _PWG_FROMPTS(ppd_size->left);
