diff options
author | Gautam Ramakrishnan <gautamramk@gmail.com> | 2020-02-10 00:03:09 +0530 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-02-09 23:33:18 +0100 |
commit | da399e213523867dea1229e8f0fd955fed0410e7 (patch) | |
tree | 01bed955c1b11dbbaecff4357e423e426416f2b4 | |
parent | 5c151e1491dd609ac5c8a8fbea42f21178a682db (diff) | |
download | ffmpeg-da399e213523867dea1229e8f0fd955fed0410e7.tar.gz |
libswscale/utils.c: Fix bug #8255
Bug #8255 points out a double free error in libwscale/utils.c file.
The double free is because the pointer to cascaded_context of an
sw_context is not set to NULL after freeing it. When the sw_context
is later freed, sws_freeContext is called on the cascaded_context,
causing a double free.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libswscale/utils.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; } |