Commit 5b43487d authored by Benoit Fouet's avatar Benoit Fouet
Browse files

test context before accessing it

Originally committed as revision 9436 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 9de8e6ac
......@@ -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