mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-02-07 02:10:00 +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
2b66ed91e6
commit
df2c70bd95
1 changed files with 8 additions and 2 deletions
|
|
@ -250,7 +250,10 @@ AVBufferPool *av_buffer_pool_init2(buffer_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;
|
||||
|
|
@ -269,7 +272,10 @@ AVBufferPool *av_buffer_pool_init(buffer_size_t size, AVBufferRef* (*alloc)(buff
|
|||
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…
Add table
Add a link
Reference in a new issue