ffmpeg | branch: master | Andreas Rheinhardt <[email protected]> | Tue Apr 15 01:45:54 2025 +0200| [7ee7632cb846c31b59f4e563790586fe97edf88a] | committer: Andreas Rheinhardt
fftools/textformat/avtextformat: Fix segfault upon allocation error Reviewed-by: softworkz . <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]> > 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; _______________________________________________ ffmpeg-cvslog mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
