Simplify: use FFMIN

Originally committed as revision 20213 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Reimar Döffinger
2009-10-12 16:36:48 +00:00
parent b5ca9cd36f
commit 098d8e0950

View File

@ -107,9 +107,7 @@ void put_buffer(ByteIOContext *s, const unsigned char *buf, int size)
int len; int len;
while (size > 0) { while (size > 0) {
len = (s->buf_end - s->buf_ptr); len = FFMIN(s->buf_end - s->buf_ptr, size);
if (len > size)
len = size;
memcpy(s->buf_ptr, buf, len); memcpy(s->buf_ptr, buf, len);
s->buf_ptr += len; s->buf_ptr += len;