From f3a22d396ab39844720735be5250743148d8c03e Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Thu, 31 Aug 2017 15:01:25 -0500 Subject: [PATCH] [libpng16] Trivial reordering of libpng_read_fuzzer.cc --- contrib/oss-fuzz/libpng_read_fuzzer.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/oss-fuzz/libpng_read_fuzzer.cc b/contrib/oss-fuzz/libpng_read_fuzzer.cc index 1f12657ce..bcef68c85 100644 --- a/contrib/oss-fuzz/libpng_read_fuzzer.cc +++ b/contrib/oss-fuzz/libpng_read_fuzzer.cc @@ -68,16 +68,17 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { } PngObjectHandler png_handler; + png_handler.png_ptr = nullptr; + png_handler.row_ptr = nullptr; + png_handler.info_ptr = nullptr; + png_handler.end_info_ptr = nullptr; + png_handler.png_ptr = png_create_read_struct (PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); if (!png_handler.png_ptr) { return 0; } - png_handler.row_ptr = nullptr; - png_handler.info_ptr = nullptr; - png_handler.end_info_ptr = nullptr; - #define PNG_CLEANUP if(png_handler.png_ptr) \ { \