aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2020-01-30 21:58:04 +0000
committerChromium commit bot <commit-bot@chromium.org>2020-01-30 21:58:04 +0000
commit04bb1f2f035343217875ce0fc19d3a7abde41717 (patch)
tree9b840654ee34ce35557fcd38bd21f28f50db7a4f /testing
parent5071ae68a0f77fea16fb30baa3c96ca338b75184 (diff)
downloadplatform_external_pdfium-04bb1f2f035343217875ce0fc19d3a7abde41717.tar.gz
platform_external_pdfium-04bb1f2f035343217875ce0fc19d3a7abde41717.tar.bz2
platform_external_pdfium-04bb1f2f035343217875ce0fc19d3a7abde41717.zip
Remove |offsets| parameter from CJPX_Decoder::Decode().
The decoder does not need this level of flexibility. Replace it with a |swap_rgb| parameter and calculate the offsets internally in a foolproof manner. Also rename a local variable in one caller to better describe what it represents and to avoid Hungarian notation. Change-Id: I6948517dd4af03d942be08e3e597c1c667e71396 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/65791 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'testing')
-rw-r--r--testing/fuzzers/pdf_jpx_fuzzer.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/testing/fuzzers/pdf_jpx_fuzzer.cc b/testing/fuzzers/pdf_jpx_fuzzer.cc
index 89705dddd..3986ae23c 100644
--- a/testing/fuzzers/pdf_jpx_fuzzer.cc
+++ b/testing/fuzzers/pdf_jpx_fuzzer.cc
@@ -71,10 +71,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
static_cast<uint32_t>(bitmap->GetHeight()))
return 0;
- std::vector<uint8_t> output_offsets(image_info.components);
- for (uint32_t i = 0; i < image_info.components; ++i)
- output_offsets[i] = i;
+ decoder->Decode(bitmap->GetBuffer(), bitmap->GetPitch(),
+ /*swap_rgb=*/false);
- decoder->Decode(bitmap->GetBuffer(), bitmap->GetPitch(), output_offsets);
return 0;
}