mirror of https://git.ffmpeg.org/ffmpeg.git
test context before accessing it
Originally committed as revision 9436 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
9de8e6acf9
commit
5b43487d23
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue