summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Fouet <benoit.fouet@free.fr>2007-06-26 18:00:50 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2007-06-26 18:00:50 +0000
commit5b43487d23204001070efd44430134b5ea8e0087 (patch)
tree9b225d3cfa2f5ce0aea4bcfc105f69e43dcb07ff
parent9de8e6acf9ea4f6f722cb75585a6488edd6cabb9 (diff)
test context before accessing it
Originally committed as revision 9436 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/imgresample.c1
1 files changed, 1 insertions, 0 deletions
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");