| Index: samples/pdfium_test.cc
|
| diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
|
| index 068dbaa767b313ac1d6c62c2f039e10bc3627737..d473c4716a92bb2c17c0ac79a152c1c4674b62aa 100644
|
| --- a/samples/pdfium_test.cc
|
| +++ b/samples/pdfium_test.cc
|
| @@ -505,6 +505,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 ++;
|
|
|