Revision d31dbec3 libavutil/internal.h

View differences:

libavutil/internal.h
249 249
#define perror please_use_av_log_instead_of_perror
250 250
#endif
251 251

  
252
#define CHECKED_ALLOC(p, size)\
252
#define FF_ALLOC_OR_GOTO(ctx, p, size, label)\
253 253
{\
254 254
    p = av_malloc(size);\
255 255
    if (p == NULL && (size) != 0) {\
256
        av_log(NULL, AV_LOG_ERROR, "Cannot allocate memory.\n");\
257
        goto fail;\
256
        av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\
257
        goto label;\
258 258
    }\
259 259
}
260 260

  
261
#define CHECKED_ALLOCZ(p, size)\
261
#define FF_ALLOCZ_OR_GOTO(ctx, p, size, label)\
262 262
{\
263 263
    p = av_mallocz(size);\
264 264
    if (p == NULL && (size) != 0) {\
265
        av_log(NULL, AV_LOG_ERROR, "Cannot allocate memory.\n");\
266
        goto fail;\
265
        av_log(ctx, AV_LOG_ERROR, "Cannot allocate memory.\n");\
266
        goto label;\
267 267
    }\
268 268
}
269 269

  

Also available in: Unified diff