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.
This commit is contained in:
Michael Niedermayer authored and michaelni committed 2026-10-31 13:49:30 +00:00
1 parent 00edc310fa
commit 4b1149c8eb
1 file changed
+1 -1
+1 -1
View File
@@ -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;
}