Commit fcbea93c authored by Zhang Rui's avatar Zhang Rui Committed by Michael Niedermayer

avutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_generic_write()

Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 6e80fe1e
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment