1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

test context before accessing it

Originally committed as revision 9436 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Benoit Fouet 2007-06-26 18:00:50 +00:00
parent 9de8e6acf9
commit 5b43487d23

View File

@ -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");