summaryrefslogtreecommitdiff
path: root/testing/libfuzzer
diff options
context:
space:
mode:
authorkcwu <kcwu@chromium.org>2016-09-23 09:26:51 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-23 09:26:51 -0700
commit4dd613cb51c1d77ac2998f760325ed5b93f4ebf0 (patch)
tree5026a0aa7a55f6f0edfc40702ec5f55fd05502ff /testing/libfuzzer
parent3f4111fbff1233de9f5c67eda433bee0f5f88c4e (diff)
downloadpdfium-4dd613cb51c1d77ac2998f760325ed5b93f4ebf0.tar.xz
Bail out on bad width and height in CCodec_FaxDecoder::CreateDecoder
BUG=648935,649436 Review-Url: https://codereview.chromium.org/2360283004
Diffstat (limited to 'testing/libfuzzer')
-rw-r--r--testing/libfuzzer/pdf_codec_fax_fuzzer.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/testing/libfuzzer/pdf_codec_fax_fuzzer.cc b/testing/libfuzzer/pdf_codec_fax_fuzzer.cc
index 1a04c31aa0..60e2c9ff19 100644
--- a/testing/libfuzzer/pdf_codec_fax_fuzzer.cc
+++ b/testing/libfuzzer/pdf_codec_fax_fuzzer.cc
@@ -34,9 +34,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
EndOfLine, ByteAlign, BlackIs1,
Columns, Rows));
- int line = 0;
- while (decoder->GetScanline(line))
- line++;
+ if (decoder) {
+ int line = 0;
+ while (decoder->GetScanline(line))
+ line++;
+ }
return 0;
}