ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | Tue Apr 15 02:11:57 2025 +0200| [50ef4b2a6b799247133503157ff1b97056b1b6d5] | committer: Andreas Rheinhardt
fftools/textformat/avtextformat: Fix segfault upon allocation error Would happen if an AVTextFormatContext's private context could not be allocated. Reviewed-by: softworkz . <softworkz-at-hotmail....@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=50ef4b2a6b799247133503157ff1b97056b1b6d5 --- 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 7edf7901e4..5e225825ba 100644 --- a/fftools/textformat/avtextformat.c +++ b/fftools/textformat/avtextformat.c @@ -112,12 +112,14 @@ int avtext_context_close(AVTextFormatContext **ptctx) av_hash_freep(&tctx->hash); - if (tctx->formatter->uninit) - tctx->formatter->uninit(tctx); + if (tctx->formatter) { + if (tctx->formatter->uninit) + tctx->formatter->uninit(tctx); + if (tctx->formatter->priv_class) + av_opt_free(tctx->priv); + } for (i = 0; i < SECTION_MAX_NB_LEVELS; i++) av_bprint_finalize(&tctx->section_pbuf[i], NULL); - if (tctx->formatter->priv_class) - av_opt_free(tctx->priv); av_freep(&tctx->priv); av_opt_free(tctx); av_freep(ptctx); _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".