summaryrefslogtreecommitdiff
path: root/fitz/filt_faxd.c
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-08-11 14:28:24 +0000
committerTor Andersson <tor@ghostscript.com>2010-08-11 14:28:24 +0000
commitbb440c5d057cf8c9f38ab07bdd5d23a0b6192e74 (patch)
tree7e8bfe168abaa6938c483c298a7a59d1bdf1da0f /fitz/filt_faxd.c
parent8ba627f03db7c54d782cb2f5c356a5ec08eb4619 (diff)
downloadmupdf-bb440c5d057cf8c9f38ab07bdd5d23a0b6192e74.tar.xz
Unstuff extra bytes read when the filters are closed instead of only when EOD is encountered.
Diffstat (limited to 'fitz/filt_faxd.c')
-rw-r--r--fitz/filt_faxd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fitz/filt_faxd.c b/fitz/filt_faxd.c
index e4a81724..dd6ac9d0 100644
--- a/fitz/filt_faxd.c
+++ b/fitz/filt_faxd.c
@@ -549,7 +549,6 @@ readfaxd(fz_stream *stm, unsigned char *buf, int len)
unsigned char *ep = buf + len;
unsigned char *tmp;
fz_error error;
- int i;
if (fax->stage == SDONE)
return 0;
@@ -692,12 +691,6 @@ eol:
rtc:
fax->stage = SDONE;
-
- /* try to put back any extra bytes we read */
- i = (32 - fax->bidx) / 8;
- while (i--)
- fz_unreadbyte(fax->chain);
-
return p - buf;
}
@@ -705,6 +698,13 @@ static void
closefaxd(fz_stream *stm)
{
fz_faxd *fax = stm->state;
+ int i;
+
+ /* if we read any extra bytes, try to put them back */
+ i = (32 - fax->bidx) / 8;
+ while (i--)
+ fz_unreadbyte(fax->chain);
+
fz_close(fax->chain);
fz_free(fax->ref);
fz_free(fax->dst);