diff options
author | warmerda <warmerda> | 2009-06-23 18:52:48 +0000 |
---|---|---|
committer | warmerda <warmerda> | 2009-06-23 18:52:48 +0000 |
commit | 73312e99feb13d2da789939fe451e71be63eea53 (patch) | |
tree | 9afe228e61ad39d359ff398acae9a266bc6ce204 | |
parent | f152a28017d3b6768c7357c5cb9a81522b31334d (diff) | |
download | libjpeg-73312e99feb13d2da789939fe451e71be63eea53.tar.gz |
keep values in src/dst structure properly during io calls (#2811021)
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | jchuff.c | 3 | ||||
-rw-r--r-- | jdhuff.c | 8 |
3 files changed, 15 insertions, 2 deletions
@@ -1,9 +1,13 @@ 2009-06-23 Frank Warmerdam <warmerdam@pobox.com> + * jchuff.c, jdhuff.c: ensure data consumed is reflected in the source + structure before io calls. + http://sourceforge.net/support/tracker.php?aid=2811021 + * jchuff.h, jdct.h, jdhuff.h, jmemsys.h, jpegint.h, jpeglib.h: Added #ifdef's to rename public API to _12 version if NEED_12_BIT_NAMES is defined. - http://sourceforge.net/support/tracker.php?aid=2809983 + http://sourceforge.net/support/tracker.php?aid=2809983 * jcparam.c: add 12bit default huffman tables. http://sourceforge.net/support/tracker.php?aid=2809979 @@ -280,6 +280,9 @@ dump_buffer (working_state * state) { struct jpeg_destination_mgr * dest = state->cinfo->dest; + dest->next_output_byte = state->next_output_byte; + dest->free_in_buffer = state->free_in_buffer; + if (! (*dest->empty_output_buffer) (state->cinfo)) return FALSE; /* After a successful buffer dump, must reset buffer pointers */ @@ -309,7 +309,11 @@ jpeg_fill_bit_buffer (bitread_working_state * state, /* Attempt to read a byte */ if (bytes_in_buffer == 0) { - if (! (*cinfo->src->fill_input_buffer) (cinfo)) + + cinfo->src->next_input_byte = next_input_byte; + cinfo->src->bytes_in_buffer = bytes_in_buffer; + + if (! (*cinfo->src->fill_input_buffer) (cinfo)) return FALSE; next_input_byte = cinfo->src->next_input_byte; bytes_in_buffer = cinfo->src->bytes_in_buffer; @@ -326,6 +330,8 @@ jpeg_fill_bit_buffer (bitread_working_state * state, */ do { if (bytes_in_buffer == 0) { + cinfo->src->next_input_byte = next_input_byte; + cinfo->src->bytes_in_buffer = bytes_in_buffer; if (! (*cinfo->src->fill_input_buffer) (cinfo)) return FALSE; next_input_byte = cinfo->src->next_input_byte; |