OSDN Git Service

avutil/buffer: Fix race in pool.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 17 Mar 2013 17:36:16 +0000 (18:36 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 18 Mar 2013 18:19:22 +0000 (19:19 +0100)
commitcea3a63ba3d89d8403eef008f7a7c54d645cff70
tree3b2e553d6edec8c8ea3fbf1e3546231d3b3e34a2
parent73ef12757b9471474bfebda20792448e9bc4e3cc
avutil/buffer: Fix race in pool.

This race will always happen sooner or later in a multi-threaded
environment and it will over time lead to OOM.
This fix works by spinning, there are other ways by which this
can be fixed, like simply detecting the issue after it happened
and freeing the over-allocated memory or simply using a mutex.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/buffer.c
libavutil/buffer_internal.h