summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec/fx_codec_embeddertest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec/codec/fx_codec_embeddertest.cpp')
-rw-r--r--core/fxcodec/codec/fx_codec_embeddertest.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/fxcodec/codec/fx_codec_embeddertest.cpp b/core/fxcodec/codec/fx_codec_embeddertest.cpp
index 50a15c3dc2..40a1662839 100644
--- a/core/fxcodec/codec/fx_codec_embeddertest.cpp
+++ b/core/fxcodec/codec/fx_codec_embeddertest.cpp
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <memory>
+
#include "testing/embedder_test.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -12,9 +14,8 @@ TEST_F(FXCodecEmbeddertest, Bug_631912) {
// Should not crash.
EXPECT_TRUE(OpenDocument("bug_631912.pdf"));
FPDF_PAGE page = LoadPage(0);
- EXPECT_NE(nullptr, page);
- FPDF_BITMAP bitmap = RenderPageDeprecated(page);
- CompareBitmap(bitmap, 691, 432, "24d75af646f8772c5ee7ced260452ae4");
- FPDFBitmap_Destroy(bitmap);
+ ASSERT_TRUE(page);
+ std::unique_ptr<void, FPDFBitmapDeleter> bitmap = RenderLoadedPage(page);
+ CompareBitmap(bitmap.get(), 691, 432, "24d75af646f8772c5ee7ced260452ae4");
UnloadPage(page);
}