summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-08-19 03:54:12 +0200
committerTor Andersson <tor@ghostscript.com>2009-08-19 03:54:12 +0200
commite70e153f8fda0b65360beeea52409b6c543e7e24 (patch)
tree9ffd0125e442a4e103faa9f90b0ce9aa978c4789 /fitz
parentd12d21f0ba50873a32a67a340e1dd1857c8c69df (diff)
downloadmupdf-e70e153f8fda0b65360beeea52409b6c543e7e24.tar.xz
Round down data buffer to be decrypted to a multiple of 16 for AES filter.
Diffstat (limited to 'fitz')
-rw-r--r--fitz/filt_aesd.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fitz/filt_aesd.c b/fitz/filt_aesd.c
index 63145bf1..9b4c0962 100644
--- a/fitz/filt_aesd.c
+++ b/fitz/filt_aesd.c
@@ -50,10 +50,7 @@ fz_processaesdfilter(fz_filter *filter, fz_buffer *in, fz_buffer *out)
return fz_ioneedout;
n = MIN(in->wp - in->rp, out->ep - out->wp);
- if (n % 16 != 0)
- return fz_throw("size of data to decrypt not a multiple of 16");
- if (n < 16)
- return fz_throw("size of data to decrypt too small");
+ n = (n / 16) * 16;
aes_crypt_cbc(&f->aes, AES_DECRYPT, n, f->iv, in->rp, out->wp);
in->rp += n;