1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avformat/rtpdec_asf: fix leak in ff_wms_parse_sdp_a_line()

In ff_wms_parse_sdp_a_line(), it allocates memory in buf, but doesn't
free buf when avformat_alloc_context() failed. Add av_free(buf) before
return to prevent from leak.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Lidong Yan
2025-06-29 14:45:26 +08:00
committed by Michael Niedermayer
parent 98afcd3da7
commit e68599f551

View File

@ -120,8 +120,10 @@ int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p)
avformat_close_input(&rt->asf_ctx);
}
if (!(iformat = av_find_input_format("asf")))
if (!(iformat = av_find_input_format("asf"))) {
av_free(buf);
return AVERROR_DEMUXER_NOT_FOUND;
}
rt->asf_ctx = avformat_alloc_context();
if (!rt->asf_ctx) {