changeset 5274:ff81ddf5de81 libavformat

Simplify: use FFMIN
author reimar
date Mon, 12 Oct 2009 16:36:48 +0000
parents f292b3e34823
children 53245f639fe5
files aviobuf.c
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/aviobuf.c	Sun Oct 11 23:09:33 2009 +0000
+++ b/aviobuf.c	Mon Oct 12 16:36:48 2009 +0000
@@ -107,9 +107,7 @@
     int len;
 
     while (size > 0) {
-        len = (s->buf_end - s->buf_ptr);
-        if (len > size)
-            len = size;
+        len = FFMIN(s->buf_end - s->buf_ptr, size);
         memcpy(s->buf_ptr, buf, len);
         s->buf_ptr += len;