diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2007-01-31 21:00:48 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2007-01-31 21:00:48 +0000 |
commit | c0a8b87600a1c24a65898d985c11adda56fa6104 (patch) | |
tree | 9b9d7c07d1009f02c639b1eb92c660b50d5ead0d /libavcodec/lzo.c | |
parent | 56f8647aaad920397c4e27728720fca6fd43c56d (diff) | |
download | ffmpeg-c0a8b87600a1c24a65898d985c11adda56fa6104.tar.gz |
Simplify checks, use that we know that cnt will not be < 0
Originally committed as revision 7787 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/lzo.c')
-rw-r--r-- | libavcodec/lzo.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/lzo.c b/libavcodec/lzo.c index c78e1f364c..54edc800ac 100644 --- a/libavcodec/lzo.c +++ b/libavcodec/lzo.c @@ -86,11 +86,11 @@ static inline int get_len(LZOContext *c, int x, int mask) { static inline void copy(LZOContext *c, int cnt) { register uint8_t *src = c->in; register uint8_t *dst = c->out; - if (src + cnt > c->in_end || src + cnt < src) { + if (cnt > c->in_end - src) { cnt = c->in_end - src; c->error |= LZO_INPUT_DEPLETED; } - if (dst + cnt > c->out_end || dst + cnt < dst) { + if (cnt > c->out_end - dst) { cnt = c->out_end - dst; c->error |= LZO_OUTPUT_FULL; } @@ -121,7 +121,7 @@ static inline void copy_backptr(LZOContext *c, int back, int cnt) { c->error |= LZO_INVALID_BACKPTR; return; } - if (dst + cnt > c->out_end || dst + cnt < dst) { + if (cnt > c->out_end - dst) { cnt = c->out_end - dst; c->error |= LZO_OUTPUT_FULL; } |