OLD | NEW |
1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <cstring> | 5 #include <cstring> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "../../../../testing/fx_string_testhelpers.h" | 8 #include "../../../../testing/fx_string_testhelpers.h" |
9 #include "../../../testing/embedder_test.h" | 9 #include "../../../testing/embedder_test.h" |
10 #include "core/include/fpdfapi/fpdf_parser.h" | 10 #include "core/include/fpdfapi/fpdf_parser.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 unsigned int result_size; | 88 unsigned int result_size; |
89 FlateDecode(ptr->input, ptr->input_size, result, result_size); | 89 FlateDecode(ptr->input, ptr->input_size, result, result_size); |
90 ASSERT_TRUE(result); | 90 ASSERT_TRUE(result); |
91 EXPECT_EQ(std::string((const char*)ptr->expected, ptr->expected_size), | 91 EXPECT_EQ(std::string((const char*)ptr->expected, ptr->expected_size), |
92 std::string((const char*)result, result_size)) | 92 std::string((const char*)result, result_size)) |
93 << " for case " << i; | 93 << " for case " << i; |
94 FX_Free(result); | 94 FX_Free(result); |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
| 98 TEST_F(FPDFParserDecodeEmbeddertest, Bug_552046) { |
| 99 // Tests specifying multiple image filters for a stream. Should not cause a |
| 100 // crash when rendered. |
| 101 EXPECT_TRUE(OpenDocument("bug_552046.pdf")); |
| 102 FPDF_PAGE page = LoadPage(0); |
| 103 FPDF_BITMAP bitmap = RenderPage(page); |
| 104 FPDFBitmap_Destroy(bitmap); |
| 105 UnloadPage(page); |
| 106 } |
| 107 |
98 #undef TEST_CASE | 108 #undef TEST_CASE |
OLD | NEW |