Commit 5f2187392e for ffmpeg
commit 5f2187392e0c38d9fcc937e12b48b1f57716e5a0
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Thu Oct 8 02:16:19 2026 +0200
avformat/rtpdec_asf: Free the reassembled packet before replacing it
Fixes: memleak
Fixes: sggQJVux0zI6
Memleak Replicated through UnModified FFmpeg with Valgrind
Found during triage of the security report 9sWoEae5AABB
diff --git a/libavformat/rtpdec_asf.c b/libavformat/rtpdec_asf.c
index 1360a39191..7489c174bc 100644
--- a/libavformat/rtpdec_asf.c
+++ b/libavformat/rtpdec_asf.c
@@ -250,6 +250,7 @@ static int asfrtp_parse_packet(AVFormatContext *s, PayloadContext *asf,
avio_skip(pb, len - off);
if (!(flags & RTP_FLAG_MARKER))
return -1;
+ av_freep(&asf->buf);
out_len = avio_close_dyn_buf(asf->pktbuf, &asf->buf);
asf->pktbuf = NULL;
} else {