Index: experimental/PdfViewer/SkPdfRenderer.cpp |
=================================================================== |
--- experimental/PdfViewer/SkPdfRenderer.cpp (revision 10010) |
+++ experimental/PdfViewer/SkPdfRenderer.cpp (working copy) |
@@ -2003,6 +2003,10 @@ |
// TODO(edisonn): create static function that could return NULL if there are errors |
fPdfDoc = new SkNativeParsedPDF(inputFileName.c_str()); |
+ if (fPdfDoc->pages() == 0) { |
+ delete fPdfDoc; |
+ fPdfDoc = NULL; |
+ } |
return fPdfDoc != NULL; |
} |
@@ -2024,4 +2028,3 @@ |
size_t SkPdfRenderer::bytesUsed() const { |
return fPdfDoc ? fPdfDoc->bytesUsed() : 0; |
} |
- |