[FFmpeg-trac] #11332(avformat:new): ffio_open_whitelist leaks memory
FFmpeg
trac at avcodec.org
Wed Dec 4 11:15:55 EET 2024
#11332: ffio_open_whitelist leaks memory
----------------------------------+----------------------------------
Reporter: oarfish | Type: defect
Status: new | Priority: normal
Component: avformat | Version: 7.1
Keywords: leak | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
----------------------------------+----------------------------------
I suspect that ffio_open_whitelist is leaking an URLContext.
In this line, a context is declared
https://github.com/FFmpeg/FFmpeg/blob/7c1e732ad2e240af5afe9ffea443c91bb233aa65/libavformat/avio.c#L475
and then allocated by ffurl_open_whitelist at
https://github.com/FFmpeg/FFmpeg/blob/7c1e732ad2e240af5afe9ffea443c91bb233aa65/libavformat/avio.c#L480C11-L480C31
However, I don't see it being freed anywhere. In my program, this causes
the leak sanitizer to report a leak:
{{{
Indirect leak of 234 byte(s) in 1 object(s) allocated from:
#0 0x7faaaa89565f in __interceptor_posix_memalign
../../../../src/libsanitizer/lsan/lsan_interceptors.cpp:110
#1 0x557e4562f3df in av_malloc libavutil/mem.c:107
#2 0x557e4562f7f3 in av_mallocz libavutil/mem.c:258
#3 0x557e458b85d0 in url_alloc_for_protocol libavformat/avio.c:139
#4 0x557e458b9271 in ffurl_alloc libavformat/avio.c:356
#5 0x557e458b92e6 in ffurl_open_whitelist libavformat/avio.c:369
#6 0x557e458b988c in ffio_open_whitelist libavformat/avio.c:480
#7 0x557e4588b767 in io_open_default libavformat/options.c:153
#8 0x557e45875a27 in init_input libavformat/demux.c:178
#9 0x557e45875d35 in avformat_open_input libavformat/demux.c:248
}}}
I did not manage to reproduce this repro this yet in a minimal executable,
will update once i can.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11332>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list