summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-08-11 13:17:47 +0000
committerTor Andersson <tor@ghostscript.com>2010-08-11 13:17:47 +0000
commit2a3efa7d61a7236b803703632ccba50b9d659c0a (patch)
tree022e76fe10fa5e7ac34cbf530a01dece95cfff36
parentfc2c66f27a3fc22748a82a735386e841ee4d527e (diff)
downloadmupdf-2a3efa7d61a7236b803703632ccba50b9d659c0a.tar.xz
Only decode as many rows as fit in the output buffer in the fax decoder, thus allowing garbage data at the end of fax images with no RTC and no Rows count.
-rw-r--r--fitz/filt_faxd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fitz/filt_faxd.c b/fitz/filt_faxd.c
index 66410660..e4a81724 100644
--- a/fitz/filt_faxd.c
+++ b/fitz/filt_faxd.c
@@ -684,6 +684,10 @@ eol:
eatbits(fax, (8 - fax->bidx) & 7);
}
+ /* no more space in output, don't decode the next line yet */
+ if (p == buf + len)
+ return p - buf;
+
goto loop;
rtc: