diff --git a/pngrutil.c b/pngrutil.c index 9dc8825f1..95e2b81c8 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -670,6 +670,10 @@ png_decompress_chunk(png_structrp png_ptr, (terminate != 0); png_bytep text = png_voidcast(png_bytep, png_malloc_base(png_ptr, buffer_size)); + /* attempt to stop an oss-fuzz "use of uninitialized value" + * in png_set_text_2() + */ + memset(text, 0, buffer_size); if (text != NULL) {