summaryrefslogtreecommitdiff
path: root/jdhuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'jdhuff.c')
-rw-r--r--jdhuff.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/jdhuff.c b/jdhuff.c
index b5ba39f..a87274e 100644
--- a/jdhuff.c
+++ b/jdhuff.c
@@ -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;