| Index: samples/pdfium_test.cc
|
| diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
|
| index e4a55f27ff466a1e589de5ad344aa69483892a1d..52e0125f09d5b0554fea12f83c9978478e22ff27 100644
|
| --- a/samples/pdfium_test.cc
|
| +++ b/samples/pdfium_test.cc
|
| @@ -518,6 +518,12 @@ void RenderPdf(const std::string& name, const char* pBuf, size_t len,
|
| int height = static_cast<int>(FPDF_GetPageHeight(page) * scale);
|
|
|
| FPDF_BITMAP bitmap = FPDFBitmap_Create(width, height, 0);
|
| + if (!bitmap) {
|
| + fprintf(stderr, "Page was too large to be rendered.\n");
|
| + bad_pages++;
|
| + continue;
|
| + }
|
| +
|
| FPDFBitmap_FillRect(bitmap, 0, 0, width, height, 0xFFFFFFFF);
|
| FPDF_RenderPageBitmap(bitmap, page, 0, 0, width, height, 0, 0);
|
| rendered_pages ++;
|
|
|