# HG changeset patch # User benoit # Date 1182880850 0 # Node ID 8a6fac216a2fa27a5d33e2216282ac98c9458fc1 # Parent a81dc8cc24fa372c2227ce8d47c815b4bae2fc20 test context before accessing it diff -r a81dc8cc24fa -r 8a6fac216a2f imgresample.c --- a/imgresample.c Tue Jun 26 16:09:55 2007 +0000 +++ b/imgresample.c Tue Jun 26 18:00:50 2007 +0000 @@ -643,6 +643,7 @@ 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");