make jpeg buffer free safer

possible race in free
This commit is contained in:
John Cupitt 2019-08-27 09:14:59 +01:00
parent f6cc2a9055
commit c8ff970476
1 changed files with 1 additions and 3 deletions

View File

@ -776,9 +776,6 @@ empty_output_buffer( j_compress_ptr cinfo )
METHODDEF(void)
init_destination( j_compress_ptr cinfo )
{
OutputBuffer *buf = (OutputBuffer *) cinfo->dest;
vips_dbuf_init( &buf->dbuf );
empty_output_buffer( cinfo );
}
@ -845,6 +842,7 @@ buf_dest( j_compress_ptr cinfo, void **obuf, size_t *olen )
/* Save output parameters.
*/
vips_dbuf_init( &buf->dbuf );
buf->obuf = obuf;
buf->olen = olen;
}