diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2010-08-02 00:17:23 +0000 |
---|---|---|
committer | Sebastian Rasmussen <sebras@hotmail.com> | 2010-08-02 00:17:23 +0000 |
commit | 28a4c167d90f07af0a77f71c397303731c00abe1 (patch) | |
tree | df41a9a5d90e67dd5269a21be55832ce057ffa28 /fitz/filt_basic.c | |
parent | 75a8fa28c53a9761936abbbb1b250299c76e8834 (diff) | |
download | mupdf-28a4c167d90f07af0a77f71c397303731c00abe1.tar.xz |
Fix bugs where pointer to remaining data in filters was not updated, also make all occurances of the code follow a common idiom.
Diffstat (limited to 'fitz/filt_basic.c')
-rw-r--r-- | fitz/filt_basic.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fitz/filt_basic.c b/fitz/filt_basic.c index 90be39ee..bac3dc23 100644 --- a/fitz/filt_basic.c +++ b/fitz/filt_basic.c @@ -25,7 +25,7 @@ readnull(fz_stream *stm, unsigned char *buf, int len) if (n < 0) return fz_rethrow(n, "read error in null filter"); state->remain -= n; - return n; + return n; } static void @@ -175,7 +175,7 @@ reada85d(fz_stream *stm, unsigned char *buf, int len) int c; while (state->remain > 0 && p < buf + len) - *p++ = state->buf[4 - state->remain]; + *p++ = state->buf[4 - state->remain--]; while (p < buf + len) { @@ -256,7 +256,7 @@ reada85d(fz_stream *stm, unsigned char *buf, int len) } while (state->remain > 0 && p < buf + len) - *p++ = state->buf[4 - state->remain]; + *p++ = state->buf[4 - state->remain--]; } return p - buf; @@ -435,8 +435,8 @@ readaesd(fz_stream *stm, unsigned char *buf, int len) state->iv[state->ivcount++] = c; } - while (p < buf + len && state->remain-- > 0) - *p++ = state->buf[16 - state->remain]; + while (state->remain > 0 && p < buf + len) + *p++ = state->buf[16 - state->remain--]; while (p < buf + len) { @@ -463,8 +463,8 @@ readaesd(fz_stream *stm, unsigned char *buf, int len) state->remain -= pad; } - while (p < buf + len && state->remain-- > 0) - *p++ = state->buf[16 - state->remain]; + while (state->remain > 0 && p < buf + len) + *p++ = state->buf[16 - state->remain--]; } return p - buf; |