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

Unified Diff: testing/libfuzzer/fuzzers/brotli_fuzzer.cc

Issue 2537133002: Update brotli to v1.0.0-snapshot. (Closed)
Patch Set: Fixed typo Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testing/libfuzzer/fuzzers/BUILD.gn ('k') | third_party/brotli/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/libfuzzer/fuzzers/brotli_fuzzer.cc
diff --git a/testing/libfuzzer/fuzzers/brotli_fuzzer.cc b/testing/libfuzzer/fuzzers/brotli_fuzzer.cc
index 5a5045a05a7712027863e64795aa688197eba283..4689416a9b6a427b2bcbe69c426362f39f84b15b 100644
--- a/testing/libfuzzer/fuzzers/brotli_fuzzer.cc
+++ b/testing/libfuzzer/fuzzers/brotli_fuzzer.cc
@@ -5,7 +5,7 @@
#include <stddef.h>
#include <stdint.h>
-#include "third_party/brotli/dec/decode.h"
+#include "third_party/brotli/include/brotli/decode.h"
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
@@ -16,7 +16,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
const int kBufferSize = 1024;
uint8_t* buffer = new uint8_t[kBufferSize];
- BrotliState* state = BrotliCreateState(0, 0, 0);
+ BrotliDecoderState* state = BrotliDecoderCreateInstance(0, 0, 0);
if (addend == 0)
addend = size;
@@ -27,19 +27,19 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
next_i = size;
size_t avail_in = next_i - i;
i = next_i;
- BrotliResult result = BROTLI_RESULT_NEEDS_MORE_OUTPUT;
- while (result == BROTLI_RESULT_NEEDS_MORE_OUTPUT) {
+ BrotliDecoderResult result = BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT;
+ while (result == BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT) {
size_t avail_out = kBufferSize;
uint8_t* next_out = buffer;
size_t total_out;
- result = BrotliDecompressStream(
- &avail_in, &next_in, &avail_out, &next_out, &total_out, state);
+ result = BrotliDecoderDecompressStream(
+ state, &avail_in, &next_in, &avail_out, &next_out, &total_out);
}
- if (result != BROTLI_RESULT_NEEDS_MORE_INPUT)
+ if (result != BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT)
break;
}
- BrotliDestroyState(state);
+ BrotliDecoderDestroyInstance(state);
delete[] buffer;
return 0;
}
« no previous file with comments | « testing/libfuzzer/fuzzers/BUILD.gn ('k') | third_party/brotli/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698