mirror of https://git.ffmpeg.org/ffmpeg.git
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 fcbea93cf8
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
634605f79e
commit
7a7ec3ccd9
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue