Only reset pointer if it is freed (#16)

The indentation shows these statements were supposed to be bracketed.
This commit is contained in:
Andrea 2021-06-28 14:24:03 +01:00 committed by GitHub
parent 2bb4ec4918
commit 89c6a70620
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -350,8 +350,10 @@ png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
comp->output_ptr[i]=NULL;
}
if (comp->max_output_ptr != 0)
{
png_free(png_ptr, comp->output_ptr);
comp->output_ptr=NULL;
}
/* write anything left in zbuf */
if (png_ptr->zstream.avail_out < (png_uint_32)png_ptr->zbuf_size)
png_write_chunk_data(png_ptr, png_ptr->zbuf,