From 3ecadc0a8e2acda3a13d7df5307137f10d66ef80 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Sat, 17 Feb 2024 11:46:11 +0100 Subject: Update bundled libjpeg to version 9f --- jpeg/jdatadst.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'jpeg/jdatadst.c') diff --git a/jpeg/jdatadst.c b/jpeg/jdatadst.c index 75ebd7c22..b3b4798ea 100644 --- a/jpeg/jdatadst.c +++ b/jpeg/jdatadst.c @@ -2,7 +2,7 @@ * jdatadst.c * * Copyright (C) 1994-1996, Thomas G. Lane. - * Modified 2009-2019 by Guido Vollbeding. + * Modified 2009-2022 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -28,17 +28,17 @@ extern void free JPP((void *ptr)); /* Expanded data destination object for stdio output */ +#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ + typedef struct { struct jpeg_destination_mgr pub; /* public fields */ FILE * outfile; /* target stream */ - JOCTET * buffer; /* start of buffer */ + JOCTET buffer[OUTPUT_BUF_SIZE]; /* output buffer */ } my_destination_mgr; typedef my_destination_mgr * my_dest_ptr; -#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ - /* Expanded data destination object for memory output */ @@ -65,10 +65,6 @@ init_destination (j_compress_ptr cinfo) { my_dest_ptr dest = (my_dest_ptr) cinfo->dest; - /* Allocate the output buffer --- it will be released when done with image */ - dest->buffer = (JOCTET *) (*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo, JPOOL_IMAGE, OUTPUT_BUF_SIZE * SIZEOF(JOCTET)); - dest->pub.next_output_byte = dest->buffer; dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; } @@ -187,8 +183,8 @@ term_mem_destination (j_compress_ptr cinfo) /* * Prepare for output to a stdio stream. - * The caller must have already opened the stream, and is responsible - * for closing it after finishing compression. + * The caller must have already opened the stream, + * and is responsible for closing it after finishing compression. */ GLOBAL(void) -- cgit v1.2.3