@@ -208,9 +208,9 @@ jpeg_stdio_dest (j_compress_ptr cinfo, FILE *outfile)
208208{
209209 my_dest_ptr dest ;
210210
211- /* The destination object is made permanent so that multiple JPEG images
212- * can be written to the same file without re-executing jpeg_stdio_dest.
213- */
211+ /* The destination object is made permanent so that multiple JPEG images
212+ * can be written to the same file without re-executing jpeg_stdio_dest.
213+ */
214214 if (cinfo -> dest == NULL ) { /* first time for this JPEG object? */
215215 cinfo -> dest = (struct jpeg_destination_mgr * )
216216 (* cinfo -> mem -> alloc_small ) ((j_common_ptr ) cinfo , JPOOL_PERMANENT ,
@@ -249,8 +249,8 @@ jpeg_stdio_dest (j_compress_ptr cinfo, FILE *outfile)
249249 */
250250
251251GLOBAL (void )
252- jpeg_mem_dest (j_compress_ptr cinfo ,
253- unsigned char * * outbuffer , unsigned long * outsize )
252+ jpeg_mem_dest_internal (j_compress_ptr cinfo ,
253+ unsigned char * * outbuffer , unsigned long * outsize , int pool_id )
254254{
255255 my_mem_dest_ptr dest ;
256256
@@ -262,7 +262,7 @@ jpeg_mem_dest (j_compress_ptr cinfo,
262262 */
263263 if (cinfo -> dest == NULL ) { /* first time for this JPEG object? */
264264 cinfo -> dest = (struct jpeg_destination_mgr * )
265- (* cinfo -> mem -> alloc_small ) ((j_common_ptr ) cinfo , JPOOL_PERMANENT ,
265+ (* cinfo -> mem -> alloc_small ) ((j_common_ptr ) cinfo , pool_id ,
266266 sizeof (my_mem_destination_mgr ));
267267 } else if (cinfo -> dest -> init_destination != init_mem_destination ) {
268268 /* It is unsafe to reuse the existing destination manager unless it was
@@ -290,4 +290,15 @@ jpeg_mem_dest (j_compress_ptr cinfo,
290290 dest -> pub .next_output_byte = dest -> buffer = * outbuffer ;
291291 dest -> pub .free_in_buffer = dest -> bufsize = * outsize ;
292292}
293+
294+ GLOBAL (void )
295+ jpeg_mem_dest (j_compress_ptr cinfo ,
296+ unsigned char * * outbuffer , unsigned long * outsize )
297+ {
298+ /* The destination object is made permanent so that multiple JPEG images
299+ * can be written to the same file without re-executing jpeg_stdio_dest.
300+ */
301+ jpeg_mem_dest_internal (cinfo , outbuffer , outsize , JPOOL_PERMANENT );
302+ }
303+
293304#endif
0 commit comments