diff --git a/libswscale/utils.c b/libswscale/utils.c index b2c08a5983..e9c66aeb4f 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -1502,6 +1502,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, ff_free_filters(c2); if (ff_init_filters(c2) < 0) { sws_freeContext(c2); + c->cascaded_context[1] = NULL; return -1; }