Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: testing/libfuzzer/pdf_jpx_fuzzer.cc

Issue 2379973005: Fix #includes in libfuzzer (Closed)
Patch Set: More include fixes Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The PDFium Authors. All rights reserved. 1 // Copyright 2016 The 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 <cstdint> 5 #include <cstdint>
6 #include <memory> 6 #include <memory>
7 #include <vector> 7 #include <vector>
8 8
9 #include "core/fxcodec/codec/codec_int.h" 9 #include "core/fxcodec/codec/codec_int.h"
10 #include "core/fxge/include/fx_dib.h" 10 #include "core/fxge/fx_dib.h"
11 11
12 CCodec_JpxModule g_module; 12 CCodec_JpxModule g_module;
13 13
14 struct DecoderDeleter { 14 struct DecoderDeleter {
15 void operator()(CJPX_Decoder* decoder) { g_module.DestroyDecoder(decoder); } 15 void operator()(CJPX_Decoder* decoder) { g_module.DestroyDecoder(decoder); }
16 }; 16 };
17 17
18 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { 18 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
19 std::unique_ptr<CJPX_Decoder, DecoderDeleter> decoder( 19 std::unique_ptr<CJPX_Decoder, DecoderDeleter> decoder(
20 g_module.CreateDecoder(data, size, nullptr)); 20 g_module.CreateDecoder(data, size, nullptr));
(...skipping 22 matching lines...) Expand all
43 return 0; 43 return 0;
44 44
45 std::vector<uint8_t> output_offsets(components); 45 std::vector<uint8_t> output_offsets(components);
46 for (uint32_t i = 0; i < components; ++i) 46 for (uint32_t i = 0; i < components; ++i)
47 output_offsets[i] = i; 47 output_offsets[i] = i;
48 48
49 g_module.Decode(decoder.get(), bitmap->GetBuffer(), bitmap->GetPitch(), 49 g_module.Decode(decoder.get(), bitmap->GetBuffer(), bitmap->GetPitch(),
50 output_offsets); 50 output_offsets);
51 return 0; 51 return 0;
52 } 52 }
OLDNEW
« no previous file with comments | « testing/libfuzzer/pdf_hint_table_fuzzer.cc ('k') | testing/libfuzzer/pdf_streamparser_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698