mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 03:39:45 +00:00
avutil/internal: add FF_ALLOC_ARRAY_OR_GOTO & FF_ALLOCZ_ARRAY_OR_GOTO
These are similar to the existing FF_ALLOCZ_OR_GOTO & FF_ALLOC_OR_GOTO Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
5e5aced585
commit
47ec0b0b0f
@ -133,6 +133,24 @@
|
||||
}\
|
||||
}
|
||||
|
||||
#define FF_ALLOC_ARRAY_OR_GOTO(ctx, p, nelem, elsize, label)\
|
||||
{\
|
||||
p = av_malloc_array(nelem, elsize);\
|
||||
if (p == NULL) {\
|
||||
av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\
|
||||
goto label;\
|
||||
}\
|
||||
}
|
||||
|
||||
#define FF_ALLOCZ_ARRAY_OR_GOTO(ctx, p, nelem, elsize, label)\
|
||||
{\
|
||||
p = av_mallocz_array(nelem, elsize);\
|
||||
if (p == NULL) {\
|
||||
av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\
|
||||
goto label;\
|
||||
}\
|
||||
}
|
||||
|
||||
#include "libm.h"
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
Loading…
Reference in New Issue
Block a user