summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-10-31 17:57:48 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-10-31 17:57:48 +0000
commit994f20cfb76f4902491a94c4ef61f55705fc124d (patch)
treee9cadf6bba1648d66317860f479baf31381267e9
parent367e7de07ec33ad045500a04dc2a180390937b27 (diff)
downloadpdfium-994f20cfb76f4902491a94c4ef61f55705fc124d.tar.xz
Fix FPE in XFACodecFuzzerchromium/3255
This is a div by 0 issue BUG=chromium:779890 Change-Id: I91ca2969ffe52fb486b1fab32abc8609cd6567a2 Reviewed-on: https://pdfium-review.googlesource.com/17250 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
-rw-r--r--testing/libfuzzer/xfa_codec_fuzzer.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/testing/libfuzzer/xfa_codec_fuzzer.h b/testing/libfuzzer/xfa_codec_fuzzer.h
index 9a1230dbf9..96074fe7cf 100644
--- a/testing/libfuzzer/xfa_codec_fuzzer.h
+++ b/testing/libfuzzer/xfa_codec_fuzzer.h
@@ -39,7 +39,8 @@ class XFACodecFuzzer {
// Skipping very large images, since they will take a long time and may lead
// to OOM.
- if (decoder->GetWidth() > kXFACodecFuzzerPixelLimit / decoder->GetHeight())
+ if (decoder->GetHeight() != 0 &&
+ decoder->GetWidth() > kXFACodecFuzzerPixelLimit / decoder->GetHeight())
return 0;
auto bitmap = pdfium::MakeRetain<CFX_DIBitmap>();