#8230 closed defect (fixed)
avformat_open_input leaks memory
Reported by: | Justinas | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | dvvideo leak |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
How to reproduce:
AVFormatContext* fmt_ctx = NULL; avformat_open_input(&fmt_ctx, "/usr/bin/ntpd", NULL, NULL);
In my system an attempt to read /usr/bin/ntpd yields "Operation not permitted", however at this point FFMPEG has already tentatively decided that this is a dv input stream. See below:
ffprobe version n4.2 Copyright (c) 2007-2019 the FFmpeg developers built with gcc 9.1.0 (GCC) configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3 libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 [dv @ 0x556a892d7640] Format dv detected only with low score of 25, misdetection possible! [dv @ 0x556a892d7640] Can't determine profile of DV input stream. /usr/bin/ntpd: Operation not permitted
Since file operations are not permitted, avformat_open_input bails out but does not fully free the allocated format context. LeakSanitizer reports a single allocation leak around 32000 bytes.
Attachments (2)
Change History (6)
comment:1 by , 5 years ago
Version: | 4.1.4 → unspecified |
---|
comment:2 by , 5 years ago
Version: | unspecified → git-master |
---|
Built the test program with the current ffmpeg git master, commit id 6023b9fbfef02b71f6acfb1b09e5a12fe9d276e2.
comment:3 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in 72704cbff4257466662729fc20e3f0ab85aa8c9e.
comment:4 by , 5 years ago
Keywords: | dvvideo leak added |
---|
Note:
See TracTickets
for help on using tickets.
Please test current FFmpeg git head and provide the complete, uncut valgrind output to make this a valid ticket.