From 5b43487d23204001070efd44430134b5ea8e0087 Mon Sep 17 00:00:00 2001 From: Benoit Fouet Date: Tue, 26 Jun 2007 18:00:50 +0000 Subject: [PATCH] test context before accessing it Originally committed as revision 9436 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/imgresample.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/imgresample.c b/libavcodec/imgresample.c index 4ed7e8c415..f69a5d5505 100644 --- a/libavcodec/imgresample.c +++ b/libavcodec/imgresample.c @@ -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");