1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-24 02:09:03 +03:00

avformat/rdt: Allocate the RMStream of a stream only once

A repeated ASMRuleBook line allocated a new RMStream for every stream it
had already set up, leaking the old one.

Memory leak Replicated through UnModified FFmpeg with ASAN
Found during triage of the security report PXsIMPp0wPaW
This commit is contained in:
Michael Niedermayer
2026-10-07 00:06:08 +02:00
committed by michaelni
parent b192fc29d6
commit d3576d034e

View File

@@ -440,6 +440,8 @@ rdt_parse_sdp_line (AVFormatContext *s, int st_index,
(count - rdt->nb_rmst) * sizeof(*rdt->rmst));
rdt->nb_rmst = count;
}
if (rdt->rmst[s->streams[n]->index])
continue;
rdt->rmst[s->streams[n]->index] = ff_rm_alloc_rmstream();
if (!rdt->rmst[s->streams[n]->index])
return AVERROR(ENOMEM);