mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-21 06:16:59 +00:00
avutil/buffer: Check ff_mutex_init() for failure
Fixes: CID1604487 Unchecked return value
Fixes: CID1604494 Unchecked return value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 82f5b20ff5
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
6381da354b
commit
e1e3ebfc38
@ -264,7 +264,10 @@ AVBufferPool *av_buffer_pool_init2(size_t size, void *opaque,
|
||||
if (!pool)
|
||||
return NULL;
|
||||
|
||||
ff_mutex_init(&pool->mutex, NULL);
|
||||
if (ff_mutex_init(&pool->mutex, NULL)) {
|
||||
av_free(pool);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pool->size = size;
|
||||
pool->opaque = opaque;
|
||||
@ -283,7 +286,10 @@ AVBufferPool *av_buffer_pool_init(size_t size, AVBufferRef* (*alloc)(size_t size
|
||||
if (!pool)
|
||||
return NULL;
|
||||
|
||||
ff_mutex_init(&pool->mutex, NULL);
|
||||
if (ff_mutex_init(&pool->mutex, NULL)) {
|
||||
av_free(pool);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pool->size = size;
|
||||
pool->alloc = alloc ? alloc : av_buffer_alloc;
|
||||
|
Loading…
Reference in New Issue
Block a user