From 11a53339805950bf2d0b429cc598c5f6b83ae1c7 Mon Sep 17 00:00:00 2001 From: James Almer Date: Fri, 1 Aug 2025 16:45:50 -0300 Subject: [PATCH] avformat/mov: free AVBPrint on error when parsing infe boxes Should fix memleaks. Signed-off-by: James Almer --- libavformat/mov.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 99201306d4..e795a1c34d 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -8928,11 +8928,13 @@ static int mov_read_infe(MOVContext *c, AVIOContext *pb, MOVAtom atom) continue; break; } - if (!item) + if (!item) { + av_bprint_finalize(&item_name, NULL); return AVERROR(ENOMEM); + } - if (ret) - av_bprint_finalize(&item_name, &item->name); + av_assert1(ret); + av_bprint_finalize(&item_name, &item->name); item->item_id = item_id; item->type = item_type;