Commit f7e29a72 authored by benoit's avatar benoit

test context before accessing it


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9436 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent bb093d7e
......@@ -643,6 +643,7 @@ struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat,
struct SwsContext *ctx;
ctx = av_malloc(sizeof(struct SwsContext));
if (ctx)
ctx->av_class = av_mallocz(sizeof(AVClass));
if (!ctx || !ctx->av_class) {
av_log(NULL, AV_LOG_ERROR, "Cannot allocate a resampling context!\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment