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

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

Issue 1839203002: [libfuzzer] improving gfx_png_image_fuzzer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testing/libfuzzer/fuzzers/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/libfuzzer/fuzzers/gfx_png_image_fuzzer.cc
diff --git a/testing/libfuzzer/fuzzers/gfx_png_image_fuzzer.cc b/testing/libfuzzer/fuzzers/gfx_png_image_fuzzer.cc
index f7161592af242b08ca73717b71e00ac7c2778e2d..82a072f80d3d383be56d71f854c83ba826b6b832 100644
--- a/testing/libfuzzer/fuzzers/gfx_png_image_fuzzer.cc
+++ b/testing/libfuzzer/fuzzers/gfx_png_image_fuzzer.cc
@@ -9,7 +9,13 @@
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- gfx::Image::CreateFrom1xPNGBytes(data, size);
+ gfx::Image image = gfx::Image::CreateFrom1xPNGBytes(data, size);
+
+ if (image.IsEmpty())
+ return 0;
+
+ image.ToSkBitmap();
+
return 0;
}
« no previous file with comments | « testing/libfuzzer/fuzzers/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698