[Ffmpeg-cvslog] r7787 - trunk/libavcodec/lzo.c

reimar subversion
Wed Jan 31 22:00:49 CET 2007


Author: reimar
Date: Wed Jan 31 22:00:48 2007
New Revision: 7787

Modified:
   trunk/libavcodec/lzo.c

Log:
Simplify checks, use that we know that cnt will not be < 0


Modified: trunk/libavcodec/lzo.c
==============================================================================
--- trunk/libavcodec/lzo.c	(original)
+++ trunk/libavcodec/lzo.c	Wed Jan 31 22:00:48 2007
@@ -86,11 +86,11 @@
 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 @@
         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;
     }




More information about the ffmpeg-cvslog mailing list