diff options
author | Zhang Rui <bbcallen@gmail.com> | 2015-07-14 14:47:26 +0800 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-14 17:28:55 +0200 |
commit | fcbea93cf8777bbef2a393d26942b5d3c70a448d (patch) | |
tree | 4550cdd70a30c63e9ec97ba22f18116080f49d9d | |
parent | 6e80fe1ecd984a59bb6c73cbb436cc06536b7728 (diff) | |
download | ffmpeg-fcbea93cf8777bbef2a393d26942b5d3c70a448d.tar.gz |
avutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_generic_write()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavutil/fifo.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavutil/fifo.c b/libavutil/fifo.c index 4ff3194c5f..f2fe93de75 100644 --- a/libavutil/fifo.c +++ b/libavutil/fifo.c @@ -129,7 +129,8 @@ int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, do { int len = FFMIN(f->end - wptr, size); if (func) { - if (func(src, wptr, len) <= 0) + len = func(src, wptr, len); + if (len <= 0) break; } else { memcpy(wptr, src, len); |