aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-04-15 00:46:37 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-04-16 06:12:05 +0200
commitf73badbf47e7dc302f5914629a22e1f16ef0cfd3 (patch)
treef071e8561dd98fde6e0892a636b0ccce55e4f59c
parent79fa31d159765bb94b24d209a396e867fe995dcc (diff)
downloadffmpeg-f73badbf47e7dc302f5914629a22e1f16ef0cfd3.tar.gz
fftools/textformat/tw_avio: Use avio_closep()
Avoids leaving dangling pointers behind. Reviewed-by: softworkz . <softworkz-at-hotmail.com@ffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--fftools/textformat/tw_avio.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fftools/textformat/tw_avio.c b/fftools/textformat/tw_avio.c
index f9fea24b19..a80b0d2588 100644
--- a/fftools/textformat/tw_avio.c
+++ b/fftools/textformat/tw_avio.c
@@ -40,9 +40,8 @@ static av_cold void iowriter_uninit(AVTextWriterContext *wctx)
{
IOWriterContext *ctx = wctx->priv;
- if (ctx->close_on_uninit && ctx->avio_context) {
- avio_close(ctx->avio_context);
- }
+ if (ctx->close_on_uninit)
+ avio_closep(&ctx->avio_context);
}
static void io_w8(AVTextWriterContext *wctx, int b)