"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "jpegdest.c" between
jpegoptim-1.4.5.tar.gz and jpegoptim-1.4.6.tar.gz

About: Jpegoptim is a utility to optimize/compress JPEG/JFIF files (providing lossless optimization).

jpegdest.c  (jpegoptim-1.4.5):jpegdest.c  (jpegoptim-1.4.6)
/* /*
* jpegdest.c * jpegdest.c
* *
* Copyright (C) 2014 Timo Kokkonen * Copyright (C) 2014 Timo Kokkonen
* All Rights Reserved. * All Rights Reserved.
* *
* custom libjpeg "Destination Manager" for saving into RAM * custom libjpeg "Destination Manager" for saving into RAM
* *
* $Id: 5f79e39501830abee802650b05b81f7827c3ba8f $ * $Id: 2689b6f6dc660d3386bf5c0ca3ea2e616faa46f7 $
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <jpeglib.h> #include <jpeglib.h>
#include <jerror.h> #include <jerror.h>
#include "jpegoptim.h" #include "jpegoptim.h"
skipping to change at line 59 skipping to change at line 59
/* abort if incsize is 0 (no expansion of buffer allowed) */ /* abort if incsize is 0 (no expansion of buffer allowed) */
if (dest->incsize == 0) ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 42); if (dest->incsize == 0) ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 42);
/* otherwise, try expanding buffer... */ /* otherwise, try expanding buffer... */
newbuf = realloc(dest->buf,dest->bufsize + dest->incsize); newbuf = realloc(dest->buf,dest->bufsize + dest->incsize);
if (!newbuf) ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 42); if (!newbuf) ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 42);
dest->pub.next_output_byte = newbuf + dest->bufsize; dest->pub.next_output_byte = newbuf + dest->bufsize;
dest->pub.free_in_buffer = dest->incsize; dest->pub.free_in_buffer = dest->incsize;
*dest->buf_ptr = newbuf;
dest->buf = newbuf; dest->buf = newbuf;
dest->bufsize += dest->incsize; dest->bufsize += dest->incsize;
dest->incsize *= 2; dest->incsize *= 2;
return TRUE; return TRUE;
} }
void jpeg_memory_term_destination (j_compress_ptr cinfo) void jpeg_memory_term_destination (j_compress_ptr cinfo)
{ {
jpeg_memory_destination_ptr dest = (jpeg_memory_destination_ptr) cinfo->dest; jpeg_memory_destination_ptr dest = (jpeg_memory_destination_ptr) cinfo->dest;
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)