[FFmpeg-cvslog] fftools/textformat/avtextformat: Fix segfault upon allocation error
Andreas Rheinhardt
git at videolan.org
Wed Apr 16 07:25:22 EEST 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Apr 15 01:45:54 2025 +0200| [7ee7632cb846c31b59f4e563790586fe97edf88a] | committer: Andreas Rheinhardt
fftools/textformat/avtextformat: Fix segfault upon allocation error
Reviewed-by: softworkz . <softworkz-at-hotmail.com at ffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7ee7632cb846c31b59f4e563790586fe97edf88a
---
fftools/textformat/avtextformat.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/fftools/textformat/avtextformat.c b/fftools/textformat/avtextformat.c
index c1b5eefab4..7edf7901e4 100644
--- a/fftools/textformat/avtextformat.c
+++ b/fftools/textformat/avtextformat.c
@@ -590,10 +590,12 @@ int avtextwriter_context_close(AVTextWriterContext **pwctx)
if (!wctx)
return EINVAL;
- if (wctx->writer->uninit)
- wctx->writer->uninit(wctx);
- if (wctx->writer->priv_class)
- av_opt_free(wctx->priv);
+ if (wctx->writer) {
+ if (wctx->writer->uninit)
+ wctx->writer->uninit(wctx);
+ if (wctx->writer->priv_class)
+ av_opt_free(wctx->priv);
+ }
av_freep(&wctx->priv);
av_freep(pwctx);
return ret;
More information about the ffmpeg-cvslog
mailing list