mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 07:31:22 +01:00
Add CHECKED_ALLOC macro.
It works the same as CHECKED_ALLOCZ except that it does not zero the allocated memory. Originally committed as revision 19742 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
6833385d30
commit
e48a0966ca
1 changed files with 9 additions and 0 deletions
|
|
@ -249,6 +249,15 @@ if((y)<(x)){\
|
|||
#define perror please_use_av_log_instead_of_perror
|
||||
#endif
|
||||
|
||||
#define CHECKED_ALLOC(p, size)\
|
||||
{\
|
||||
p= av_malloc(size);\
|
||||
if(p==NULL && (size)!=0){\
|
||||
av_log(NULL, AV_LOG_ERROR, "Cannot allocate memory.");\
|
||||
goto fail;\
|
||||
}\
|
||||
}
|
||||
|
||||
#define CHECKED_ALLOCZ(p, size)\
|
||||
{\
|
||||
p= av_mallocz(size);\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue