From 4b1149c8eb219bfbbbfd8e0cf960a208ffcf3447 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 26 Oct 2026 01:12:01 +0100 Subject: [PATCH] avformat/mov: fix leak of the gain map parameters when the tmap payload allocation fails The payload size is the item's extent length from the file, so the allocation can fail for a crafted file. Leak Replicated through UnModified FFmpeg with LSAN Found by a grok bot based audit of the code. --- libavformat/mov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 83bf9fa8d4..786994699e 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -11662,7 +11662,7 @@ static int mov_parse_heif_layered_video_tmap(AVFormatContext *s, const HEIFGroup payload = av_malloc(tmap->item->extent_length); if (!payload) { - return AVERROR(ENOMEM); + err = AVERROR(ENOMEM); goto fail; }