1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

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>
(cherry picked from commit fcbea93cf8777bbef2a393d26942b5d3c70a448d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Zhang Rui 2015-07-14 14:47:26 +08:00 committed by Michael Niedermayer
parent 2e7bd0f725
commit a330aca126

View File

@ -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);