diff options
author | Ramiro Polla <ramiro.polla@gmail.com> | 2009-09-06 00:08:19 +0000 |
---|---|---|
committer | Ramiro Polla <ramiro.polla@gmail.com> | 2009-09-06 00:08:19 +0000 |
commit | d31dbec3742e488156621b9ca21069f8c05aabf0 (patch) | |
tree | 228aff1eab65734541719151039cf763657598a5 /libavutil/internal.h | |
parent | 9cf484d06e4ca3cd9ec229966ce931e2f4cb6d79 (diff) | |
download | ffmpeg-d31dbec3742e488156621b9ca21069f8c05aabf0.tar.gz |
Rename CHECKED_ALLOC(Z) to FF_ALLOC(Z)_OR_GOTO and add context and label
parameters.
Originally committed as revision 19776 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/internal.h')
-rw-r--r-- | libavutil/internal.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavutil/internal.h b/libavutil/internal.h index 1353399b92..a129bfb35f 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -249,21 +249,21 @@ if ((y) < (x)) {\ #define perror please_use_av_log_instead_of_perror #endif -#define CHECKED_ALLOC(p, size)\ +#define FF_ALLOC_OR_GOTO(ctx, p, size, label)\ {\ p = av_malloc(size);\ if (p == NULL && (size) != 0) {\ - av_log(NULL, AV_LOG_ERROR, "Cannot allocate memory.\n");\ - goto fail;\ + av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\ + goto label;\ }\ } -#define CHECKED_ALLOCZ(p, size)\ +#define FF_ALLOCZ_OR_GOTO(ctx, p, size, label)\ {\ p = av_mallocz(size);\ if (p == NULL && (size) != 0) {\ - av_log(NULL, AV_LOG_ERROR, "Cannot allocate memory.\n");\ - goto fail;\ + av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\ + goto label;\ }\ } |