Commit 7f7c1d48b0 for ffmpeg
commit 7f7c1d48b0a1ebcdb8769eacc6bebbafac11ef87
Author: Kacper Michajłow <kasper93@gmail.com>
Date: Tue Sep 29 11:34:20 2026 +0200
avformat/dashdec: free the context if copying the whitelists fails
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 2ce6fe6c56..76352c1708 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1969,8 +1969,11 @@ static int reopen_demux_for_component(AVFormatContext *s, struct representation
pls, read_data, NULL, c->is_live ? NULL : seek_data);
pls->pb.pub.seekable = 0;
- if ((ret = ff_copy_whiteblacklists(pls->ctx, s)) < 0)
+ if ((ret = ff_copy_whiteblacklists(pls->ctx, s)) < 0) {
+ avformat_free_context(pls->ctx);
+ pls->ctx = NULL;
goto fail;
+ }
pls->ctx->flags = AVFMT_FLAG_CUSTOM_IO;
pls->ctx->probesize = s->probesize > 0 ? s->probesize : 1024 * 4;