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>
This commit is contained in:
parent
73ef12757b
commit
cea3a63ba3
2 changed files with 9 additions and 0 deletions
|
@ -85,6 +85,8 @@ struct AVBufferPool {
|
|||
*/
|
||||
volatile int refcount;
|
||||
|
||||
volatile int nb_allocated;
|
||||
|
||||
int size;
|
||||
AVBufferRef* (*alloc)(int size);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue