Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Sebechlebsky <sebechlebskyjan@gmail.com>2016-06-03 15:04:00 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2016-06-03 15:49:56 +0300
commit0e84eee7198d9e261f0efc5a0831abc55aa66fd6 (patch)
tree118a2b56335f2b5094f069b4bea8dd9d02d9ae47 /libavutil/fifo.c
parent8b05a7ffe4d78c68cd0091aefa8b380c7c4afe7a (diff)
libavutil/fifo: Fix fifo grow step
Fifo was reallocating always to twice of the requested size. This fixes it to reallocate to requested size, or twice of the original size - whichever is greater. Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil/fifo.c')
-rw-r--r--libavutil/fifo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 986729aedb..1060aedf13 100644
--- a/libavutil/fifo.c
+++ b/libavutil/fifo.c
@@ -113,7 +113,7 @@ int av_fifo_grow(AVFifoBuffer *f, unsigned int size)
size += av_fifo_size(f);
if (old_size < size)
- return av_fifo_realloc2(f, FFMAX(size, 2*size));
+ return av_fifo_realloc2(f, FFMAX(size, 2*old_size));
return 0;
}