Opened 5 years ago

Closed 5 years ago

#8150 closed defect (fixed)

memory leaks in ff_read_packet()

Reported by: Suhwan Owned by:
Priority: normal Component: avformat
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
There are a memory leakage (17,802 (24 direct, 17,778 indirect) bytes in 1 blocks are definitely lost) and a null pointer passed as argument 2, which is declared to never be null in libavutil/encryption_info.c:334:28

How to reproduce:

% ./ffmpeg_g -y -r 95 -i gizmo-frag-2.mp4 -map 0 -c copy -c: a:75 dnxhd -c: v:3 pcm_s24le -disposition: s:12 h261 -aframes 110 -ac 6 -strict 3 output/tmp.mpc8

ffmpeg version N-94887-ge55018ee11 (git master)
built on ... ubuntu 18.04 with clang-6 and ASAN and UBSAN option.

Here's Valgrind log.

==31695== Memcheck, a memory error detector
==31695== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==31695== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==31695== Command: ../ffmpeg/ffmpeg_g -y -r 95 -i samples/mp4/gizmo-frag-2.mp4 -map 0 -c copy -c: a:75 dnxhd -c: v:3 pcm_s24le -disposition: s:12 h261 -aframes 110 -ac 6 -strict 3 output/tmp.mpc8
==31695== 
ffmpeg version N-94906-gcb8d6a4e3e Copyright (c) 2000-2019 the FFmpeg developers
  built with clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
  configuration: --cc=clang --cxx=clang++ --ld=clang --enable-debug --toolchain=clang-usan
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 56.101 / 58. 56.101
  libavformat    58. 32.104 / 58. 32.104
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.102 /  7. 58.102
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
libavutil/encryption_info.c:334:28: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:43:28: note: nonnull attribute specified here
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x1644901: mov_read_packet (mov.c:7743)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x19CC748: append_packet_chunked (utils.c:282)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x1C4462D: av_grow_packet (avpacket.c:113)
==31695==    by 0x19CC799: append_packet_chunked (utils.c:289)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x1C4464E: av_grow_packet (avpacket.c:117)
==31695==    by 0x19CC799: append_packet_chunked (utils.c:289)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x1C44659: av_grow_packet (avpacket.c:117)
==31695==    by 0x19CC799: append_packet_chunked (utils.c:289)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x59BD87E: av_malloc (mem.c:82)
==31695==    by 0x595EA8E: av_buffer_alloc (buffer.c:72)
==31695==    by 0x1C448EC: av_grow_packet (avpacket.c:139)
==31695==    by 0x19CC799: append_packet_chunked (utils.c:289)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x59BD88A: av_malloc (mem.c:86)
==31695==    by 0x595EA8E: av_buffer_alloc (buffer.c:72)
==31695==    by 0x1C448EC: av_grow_packet (avpacket.c:139)
==31695==    by 0x19CC799: append_packet_chunked (utils.c:289)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x9E5EDEF: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x9E5EF91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x59BD89D: av_malloc (mem.c:87)
==31695==    by 0x595EA8E: av_buffer_alloc (buffer.c:72)
==31695==    by 0x1C448EC: av_grow_packet (avpacket.c:139)
==31695==    by 0x19CC799: append_packet_chunked (utils.c:289)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x1C44C3B: av_grow_packet (avpacket.c:146)
==31695==    by 0x19CC799: append_packet_chunked (utils.c:289)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x1C44C85: av_grow_packet (avpacket.c:147)
==31695==    by 0x19CC799: append_packet_chunked (utils.c:289)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x1C44C89: av_grow_packet (avpacket.c:147)
==31695==    by 0x19CC799: append_packet_chunked (utils.c:289)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x1C44C8E: av_grow_packet (avpacket.c:147)
==31695==    by 0x19CC799: append_packet_chunked (utils.c:289)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Use of uninitialised value of size 8
==31695==    at 0x1C44C93: av_grow_packet (avpacket.c:147)
==31695==    by 0x19CC799: append_packet_chunked (utils.c:289)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x143A42D: avio_read (aviobuf.c:655)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x143AAA2: avio_read (aviobuf.c:656)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x143AD0A: avio_read (aviobuf.c:658)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x143AD70: avio_read (aviobuf.c:655)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x143AAAA: avio_read (aviobuf.c:657)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x9E636E6: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x143AB15: avio_read (aviobuf.c:686)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x9E63831: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x143AB15: avio_read (aviobuf.c:686)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x9E63711: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x143AB15: avio_read (aviobuf.c:686)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x9E637EE: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x143AB15: avio_read (aviobuf.c:686)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x9E63806: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x143AB15: avio_read (aviobuf.c:686)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x9E6372F: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x143AB15: avio_read (aviobuf.c:686)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Use of uninitialised value of size 8
==31695==    at 0x9E63750: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x143AB15: avio_read (aviobuf.c:686)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Use of uninitialised value of size 8
==31695==    at 0x9E63753: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x143AB15: avio_read (aviobuf.c:686)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x9E6375F: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x143AB15: avio_read (aviobuf.c:686)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x9E63774: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x143AB15: avio_read (aviobuf.c:686)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x143AB32: avio_read (aviobuf.c:687)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x143AB3B: avio_read (aviobuf.c:687)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x143AB73: avio_read (aviobuf.c:688)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x143AB7E: avio_read (aviobuf.c:688)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x143AB96: avio_read (aviobuf.c:689)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x143ABA4: avio_read (aviobuf.c:655)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x143AD7D: avio_read (aviobuf.c:692)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x143AEA1: avio_read (aviobuf.c:696)
==31695==    by 0x19CC7E3: append_packet_chunked (utils.c:293)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x19CC7E6: append_packet_chunked (utils.c:294)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x19CC7F6: append_packet_chunked (utils.c:299)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x19CC802: append_packet_chunked (utils.c:0)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x19CC926: append_packet_chunked (utils.c:305)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x19CC943: append_packet_chunked (utils.c:307)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x19CC961: append_packet_chunked (utils.c:307)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x1644E99: mov_read_packet (mov.c:7763)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x11c4b740] Incorrect number of samples in encryption info
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x11c4b740] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none(bt709), 560x320, 151 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x14359AA: avio_seek (aviobuf.c:269)
==31695==    by 0x19FFC94: avio_tell (avio.h:559)
==31695==    by 0x19FFC94: avformat_find_stream_info (utils.c:4176)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F83F: ffmpeg_parse_options (ffmpeg_opt.c:3315)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'samples/mp4/gizmo-frag-2.mp4':
  Metadata:
    major_brand     : iso5
    minor_version   : 1
    compatible_brands: avc1iso5dash
    creation_time   : 2014-03-26T00:20:53.000000Z
    encoder         : HandBrake 0.9.9 2013052900
  Duration: 00:00:02.00, bitrate: 608 kb/s
    Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none(bt709), 560x320, 151 kb/s, SAR 1:1 DAR 7:4, 30 fps, 90k tbr, 90k tbn, 180k tbc (default)
    Metadata:
      creation_time   : 2014-03-26T00:20:53.000000Z
      encoder         : JVT/AVC Coding
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 65 kb/s (default)
    Metadata:
      creation_time   : 2014-03-26T00:20:53.000000Z
    Side data:
      unknown side data type 24 (68 bytes)
[NULL @ 0x11e912c0] Unable to find a suitable output format for 'dnxhd'
dnxhd: Invalid argument
==31695== Conditional jump or move depends on uninitialised value(s)
==31695==    at 0x14337DC: flush_buffer (aviobuf.c:182)
==31695==    by 0x144090E: avio_close (aviobuf.c:1225)
==31695==    by 0x48BB3D: ffmpeg_cleanup (ffmpeg.c:589)
==31695==    by 0x476322: exit_program (cmdutils.c:139)
==31695==    by 0x445A6D: open_output_file (ffmpeg_opt.c:2153)
==31695==    by 0x42FB4E: open_files (ffmpeg_opt.c:3275)
==31695==    by 0x42F8F6: ffmpeg_parse_options (ffmpeg_opt.c:3329)
==31695==    by 0x489A23: main (ffmpeg.c:4872)
==31695== 
==31695== 
==31695== HEAP SUMMARY:
==31695==     in use at exit: 18,878 bytes in 47 blocks
==31695==   total heap usage: 827 allocs, 780 frees, 2,257,856 bytes allocated
==31695== 
==31695== 17,802 (24 direct, 17,778 indirect) bytes in 1 blocks are definitely lost in loss record 34 of 34
==31695==    at 0x9E5EE76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x9E5EF91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31695==    by 0x59BDC99: av_malloc (mem.c:87)
==31695==    by 0x59BDC99: av_mallocz (mem.c:238)
==31695==    by 0x595E843: av_buffer_create (buffer.c:49)
==31695==    by 0x595EAAC: av_buffer_alloc (buffer.c:76)
==31695==    by 0x1C448EC: av_grow_packet (avpacket.c:139)
==31695==    by 0x19CC799: append_packet_chunked (utils.c:289)
==31695==    by 0x1644E94: mov_read_packet (mov.c:7762)
==31695==    by 0x19D2130: ff_read_packet (utils.c:856)
==31695==    by 0x19DC00E: read_frame_internal (utils.c:1582)
==31695==    by 0x19F2B51: avformat_find_stream_info (utils.c:3786)
==31695==    by 0x431FF9: open_input_file (ffmpeg_opt.c:1126)
==31695== 
==31695== LEAK SUMMARY:
==31695==    definitely lost: 24 bytes in 1 blocks
==31695==    indirectly lost: 17,778 bytes in 2 blocks
==31695==      possibly lost: 0 bytes in 0 blocks
==31695==    still reachable: 1,076 bytes in 44 blocks
==31695==         suppressed: 0 bytes in 0 blocks
==31695== Reachable blocks (those to which a pointer was found) are not shown.
==31695== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==31695== 
==31695== For counts of detected and suppressed errors, rerun with: -v
==31695== Use --track-origins=yes to see where uninitialised values come from
==31695== ERROR SUMMARY: 599 errors from 46 contexts (suppressed: 0 from 0)

ASAN log

ffmpeg version N-94887-ge55018ee11 Copyright (c) 2000-2019 the FFmpeg developers
  built with clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
  configuration: --cc=afl-clang --cxx=afl-clang++ --ld=afl-clang  --enable-debug --toolchain=clang-asan
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 56.101 / 58. 56.101
  libavformat    58. 32.104 / 58. 32.104
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.102 /  7. 58.102
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
libavutil/encryption_info.c:334:28: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:43:28: note: nonnull attribute specified here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libavutil/encryption_info.c:334:28 in 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x61b000000080] Incorrect number of samples in encryption info
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x61b000000080] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none(bt709), 560x320, 151 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'samples/mp4/gizmo-frag-2.mp4':
  Metadata:
    major_brand     : iso5
    minor_version   : 1
    compatible_brands: avc1iso5dash
    creation_time   : 2014-03-26T00:20:53.000000Z
    encoder         : HandBrake 0.9.9 2013052900
  Duration: 00:00:02.00, bitrate: 608 kb/s
    Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none(bt709), 560x320, 151 kb/s, SAR 1:1 DAR 7:4, 30 fps, 90k tbr, 90k tbn, 180k tbc (default)
    Metadata:
      creation_time   : 2014-03-26T00:20:53.000000Z
      encoder         : JVT/AVC Coding
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 65 kb/s (default)
    Metadata:
      creation_time   : 2014-03-26T00:20:53.000000Z
    Side data:
      unknown side data type 24 (68 bytes)
[NULL @ 0x61b000001580] Unable to find a suitable output format for 'dnxhd'
dnxhd: Invalid argument

=================================================================
==19403==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x4e07c8 in posix_memalign (ffmpeg_g+0x4e07c8)
    #1 0x202ff1df in av_malloc ffmpeg/libavutil/mem.c:87:9
    #2 0x202ff1df in av_mallocz ffmpeg/libavutil/mem.c:238
    #3 0x2000a689 in av_buffer_create ffmpeg/libavutil/buffer.c:49:11
    #4 0x2000bc78 in av_buffer_alloc ffmpeg/libavutil/buffer.c:76:11
    #5 0x9f59124 in av_grow_packet ffmpeg/libavcodec/avpacket.c:139:20

Indirect leak of 17738 byte(s) in 1 object(s) allocated from:
    #0 0x4e07c8 in posix_memalign (ffmpeg_g+0x4e07c8)
    #1 0x202fa8b7 in av_malloc ffmpeg/libavutil/mem.c:87:9
    #2 0x2000bbcd in av_buffer_alloc ffmpeg/libavutil/buffer.c:72:12
    #3 0x9f59124 in av_grow_packet ffmpeg/libavcodec/avpacket.c:139:20

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x4e07c8 in posix_memalign (ffmpeg_g+0x4e07c8)
    #1 0x202ff1df in av_malloc ffmpeg/libavutil/mem.c:87:9
    #2 0x202ff1df in av_mallocz ffmpeg/libavutil/mem.c:238
    #3 0x2000976a in av_buffer_create ffmpeg/libavutil/buffer.c:35:11
    #4 0x2000bc78 in av_buffer_alloc ffmpeg/libavutil/buffer.c:76:11
    #5 0x9f59124 in av_grow_packet ffmpeg/libavcodec/avpacket.c:139:20

SUMMARY: AddressSanitizer: 17802 byte(s) leaked in 3 allocation(s).

Attachments (2)

gizmo-frag-2.mp4 (148.6 KB ) - added by Suhwan 5 years ago.
poc
83fcd9aa47ccb67acd70991b237046d95d1c4467 (45.9 KB ) - added by Suhwan 5 years ago.
poc

Download all attachments as: .zip

Change History (8)

by Suhwan, 5 years ago

Attachment: gizmo-frag-2.mp4 added

poc

comment:1 by James, 5 years ago

Resolution: invalid
Status: newclosed

Can't reproduce with GCC 9, so probably a miscompilation bug from Clang

[jamrial@ArchVM build]$ valgrind --error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=../ffmpeg/tests/fate-valgrind.supp ./ffmpeg_g -y -r 95 -i gizmo-frag-2.mp4 -map 0 -c copy -c: a:75 dnxhd -c: v:3 pcm_s24le -disposition: s:12 h261 -aframes 110 -ac 6 -strict 3 tmp.mpc8
==44883== Memcheck, a memory error detector
==44883== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==44883== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==44883== Command: ./ffmpeg_g -y -r 95 -i gizmo-frag-2.mp4 -map 0 -c copy -c: a:75 dnxhd -c: v:3 pcm_s24le -disposition: s:12 h261 -aframes 110 -ac 6 -strict 3 tmp.mpc8
==44883==
ffmpeg version N-94969-gc2ab998ff3 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.1.0 (GCC)
  configuration: --enable-gpl --enable-debug
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 57.100 / 58. 57.100
  libavformat    58. 32.104 / 58. 32.104
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.102 /  7. 58.102
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x4fd26c0] Incorrect number of samples in encryption info
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x4fd26c0] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none(bt709), 560x320, 151 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'gizmo-frag-2.mp4':
  Metadata:
    major_brand     : iso5
    minor_version   : 1
    compatible_brands: avc1iso5dash
    creation_time   : 2014-03-26T00:20:53.000000Z
    encoder         : HandBrake 0.9.9 2013052900
  Duration: 00:00:02.00, bitrate: 608 kb/s
    Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none(bt709), 560x320, 151 kb/s, SAR 1:1 DAR 7:4, 30 fps, 90k tbr, 90k tbn, 180k tbc (default)
    Metadata:
      creation_time   : 2014-03-26T00:20:53.000000Z
      encoder         : JVT/AVC Coding
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 65 kb/s (default)
    Metadata:
      creation_time   : 2014-03-26T00:20:53.000000Z
    Side data:
      unknown side data type 24 (68 bytes)
[NULL @ 0x52183c0] Unable to find a suitable output format for 'dnxhd'
dnxhd: Invalid argument
==44883==
==44883== HEAP SUMMARY:
==44883==     in use at exit: 1,044 bytes in 43 blocks
==44883==   total heap usage: 826 allocs, 783 frees, 2,258,152 bytes allocated
==44883==
==44883== LEAK SUMMARY:
==44883==    definitely lost: 0 bytes in 0 blocks
==44883==    indirectly lost: 0 bytes in 0 blocks
==44883==      possibly lost: 0 bytes in 0 blocks
==44883==    still reachable: 1,044 bytes in 43 blocks
==44883==         suppressed: 0 bytes in 0 blocks
==44883== Reachable blocks (those to which a pointer was found) are not shown.
==44883== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==44883==
==44883== For counts of detected and suppressed errors, rerun with: -v
==44883== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

comment:2 by Suhwan, 5 years ago

Resolution: invalid
Status: closedreopened

I compiled ffmpeg with gcc-7 and uploaded other poc file.
how to reproduce :

$ valgrind -v --leak-check=full --show-leak-kinds=all ./ffmpeg_g -t 3 -y -i 83fcd9aa47ccb67acd70991b237046d95d1c4467 -target vcd -loglevel 99 -map 0 -c: s:10 vorbis -disposition: v:195 dca -aframes 64 -ab 507k -ac 22 tmp.rsd
==34782== Memcheck, a memory error detector
==34782== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==34782== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==34782== Command: ../ffmpeg/ffmpeg_g -t 3 -y -i samples/png/chrome/83fcd9aa47ccb67acd70991b237046d95d1c4467 -target vcd -loglevel 99 -map 0 -c: s:10 vorbis -disposition: v:195 dca -aframes 64 -ab 507k -ac 22 output/tmp.rsd
==34782== 
--34782-- Valgrind options:
--34782--    -v
--34782--    --leak-check=full
--34782--    --show-leak-kinds=all
--34782-- Contents of /proc/version:
--34782--   Linux version 5.0.0-25-generic (buildd@lcy01-amd64-014) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #26~18.04.1-Ubuntu SMP Thu Aug 1 13:51:02 UTC 2019
--34782-- 
--34782-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2-bmi
--34782-- Page sizes: currently 4096, max supported 4096
--34782-- Valgrind library directory: /usr/lib/valgrind
--34782-- Reading syms from ffmpeg_g
--34782-- Reading syms from /lib/x86_64-linux-gnu/ld-2.27.so
--34782--   Considering /lib/x86_64-linux-gnu/ld-2.27.so ..
--34782--   .. CRC mismatch (computed 1b7c895e wanted 2943108a)
--34782--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.27.so ..
--34782--   .. CRC is valid
--34782-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
--34782--   Considering /usr/lib/valgrind/memcheck-amd64-linux ..
--34782--   .. CRC mismatch (computed c25f395c wanted 0a9602a8)
--34782--    object doesn't have a symbol table
--34782--    object doesn't have a dynamic symbol table
--34782-- Scheduler: using generic scheduler lock implementation.
--34782-- Reading suppressions file: /usr/lib/valgrind/default.supp
==34782== 
==34782== TO CONTROL THIS PROCESS USING vgdb (which you probably
==34782== don't want to do, unless you know exactly what you're doing,
==34782== or are doing some strange experiment):
==34782==   /usr/lib/valgrind/../../bin/vgdb --pid=34782 ...command...
==34782== 
==34782== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==34782==   /path/to/gdb ../ffmpeg/ffmpeg_g
==34782== and then give GDB the following command
==34782==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=34782
==34782== --pid is optional if only one valgrind process is running
==34782== 
--34782-- REDIR: 0x401f2f0 (ld-linux-x86-64.so.2:strlen) redirected to 0x58060901 (???)
--34782-- REDIR: 0x401f0d0 (ld-linux-x86-64.so.2:index) redirected to 0x5806091b (???)
--34782-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
--34782--   Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
--34782--   .. CRC mismatch (computed 4b63d83e wanted 670599e6)
--34782--    object doesn't have a symbol table
--34782-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
--34782--   Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
--34782--   .. CRC mismatch (computed a4b37bee wanted 8ad4dc94)
--34782--    object doesn't have a symbol table
==34782== WARNING: new redirection conflicts with existing -- ignoring it
--34782--     old: 0x0401f2f0 (strlen              ) R-> (0000.0) 0x58060901 ???
--34782--     new: 0x0401f2f0 (strlen              ) R-> (2007.0) 0x04c32db0 strlen
--34782-- REDIR: 0x401d360 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4c33ee0 (strcmp)
--34782-- REDIR: 0x401f830 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4c374f0 (mempcpy)
--34782-- Reading syms from /lib/x86_64-linux-gnu/libm-2.27.so
--34782--   Considering /lib/x86_64-linux-gnu/libm-2.27.so ..
--34782--   .. CRC mismatch (computed 7feae033 wanted b29b2508)
--34782--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libm-2.27.so ..
--34782--   .. CRC is valid
--34782-- Reading syms from /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
--34782--    object doesn't have a symbol table
--34782-- Reading syms from /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
--34782--    object doesn't have a symbol table
--34782-- Reading syms from /usr/lib/x86_64-linux-gnu/libxcb-shape.so.0.0.0
--34782--    object doesn't have a symbol table
--34782-- Reading syms from /usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0.0.0
--34782--    object doesn't have a symbol table
--34782-- Reading syms from /usr/lib/x86_64-linux-gnu/libasound.so.2.0.0
--34782--    object doesn't have a symbol table
--34782-- Reading syms from /lib/x86_64-linux-gnu/libbz2.so.1.0.4
--34782--    object doesn't have a symbol table
--34782-- Reading syms from /lib/x86_64-linux-gnu/libz.so.1.2.11
--34782--    object doesn't have a symbol table
--34782-- Reading syms from /lib/x86_64-linux-gnu/liblzma.so.5.2.2
--34782--    object doesn't have a symbol table
--34782-- Reading syms from /lib/x86_64-linux-gnu/libpthread-2.27.so
--34782--   Considering /usr/lib/debug/.build-id/28/c6aade70b2d40d1f0f3d0a1a0cad1ab816448f.debug ..
--34782--   .. build-id is valid
--34782-- Reading syms from /lib/x86_64-linux-gnu/libc-2.27.so
--34782--   Considering /lib/x86_64-linux-gnu/libc-2.27.so ..
--34782--   .. CRC mismatch (computed b1c74187 wanted 042cc048)
--34782--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.27.so ..
--34782--   .. CRC is valid
--34782-- Reading syms from /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
--34782--   Considering /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0 ..
--34782--   .. CRC mismatch (computed 256f5df8 wanted 5d40ac88)
--34782--    object doesn't have a symbol table
--34782-- Reading syms from /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
--34782--    object doesn't have a symbol table
--34782-- Reading syms from /lib/x86_64-linux-gnu/libdl-2.27.so
--34782--   Considering /lib/x86_64-linux-gnu/libdl-2.27.so ..
--34782--   .. CRC mismatch (computed bd82fa02 wanted d1fdccc9)
--34782--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libdl-2.27.so ..
--34782--   .. CRC is valid
--34782-- Reading syms from /lib/x86_64-linux-gnu/librt-2.27.so
--34782--   Considering /lib/x86_64-linux-gnu/librt-2.27.so ..
--34782--   .. CRC mismatch (computed 16979484 wanted f9e041e3)
--34782--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/librt-2.27.so ..
--34782--   .. CRC is valid
--34782-- Reading syms from /lib/x86_64-linux-gnu/libbsd.so.0.8.7
--34782--    object doesn't have a symbol table
--34782-- REDIR: 0x6628c70 (libc.so.6:memmove) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6627d40 (libc.so.6:strncpy) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6628f50 (libc.so.6:strcasecmp) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6627790 (libc.so.6:strcat) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6627d70 (libc.so.6:rindex) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x662a7c0 (libc.so.6:rawmemchr) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6628de0 (libc.so.6:mempcpy) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6628c10 (libc.so.6:bcmp) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6627d00 (libc.so.6:strncmp) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6627800 (libc.so.6:strcmp) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6628d40 (libc.so.6:memset) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x66460f0 (libc.so.6:wcschr) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6627ca0 (libc.so.6:strnlen) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6627870 (libc.so.6:strcspn) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6628fa0 (libc.so.6:strncasecmp) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6627840 (libc.so.6:strcpy) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x66290e0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6627da0 (libc.so.6:strpbrk) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x66277c0 (libc.so.6:index) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6627c70 (libc.so.6:strlen) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x66326c0 (libc.so.6:memrchr) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6628ff0 (libc.so.6:strcasecmp_l) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6628be0 (libc.so.6:memchr) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6646eb0 (libc.so.6:wcslen) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6628050 (libc.so.6:strspn) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6628f20 (libc.so.6:stpncpy) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6628ef0 (libc.so.6:stpcpy) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x662a7f0 (libc.so.6:strchrnul) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6629040 (libc.so.6:strncasecmp_l) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x66bb8a0 (libc.so.6:__memcpy_chk) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x6628b20 (libc.so.6:strstr) redirected to 0x4a2a6e0 (_vgnU_ifunc_wrapper)
--34782-- REDIR: 0x67183c0 (libc.so.6:__strrchr_avx2) redirected to 0x4c32730 (rindex)
--34782-- REDIR: 0x6717fa0 (libc.so.6:__strchr_avx2) redirected to 0x4c32950 (index)
--34782-- REDIR: 0x6718590 (libc.so.6:__strlen_avx2) redirected to 0x4c32cf0 (strlen)
--34782-- REDIR: 0x670f510 (libc.so.6:__strncmp_sse42) redirected to 0x4c33570 (__strncmp_sse42)
--34782-- REDIR: 0x66f3d60 (libc.so.6:__strcmp_ssse3) redirected to 0x4c33da0 (strcmp)
--34782-- REDIR: 0x67181d0 (libc.so.6:__strchrnul_avx2) redirected to 0x4c37020 (strchrnul)
--34782-- REDIR: 0x6718ab0 (libc.so.6:__mempcpy_avx_unaligned_erms) redirected to 0x4c37130 (mempcpy)
--34782-- REDIR: 0x66bbc70 (libc.so.6:__strcpy_chk) redirected to 0x4c37090 (__strcpy_chk)
--34782-- REDIR: 0x6628590 (libc.so.6:__GI_strstr) redirected to 0x4c37760 (__strstr_sse2)
ffmpeg version N-94969-gc2ab998ff3 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
  configuration: --cc=gcc --cxx=g++ --ld=gcc --enable-debug
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 57.100 / 58. 57.100
  libavformat    58. 32.104 / 58. 32.104
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.102 /  7. 58.102
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
--34782-- REDIR: 0x6624d70 (libc.so.6:posix_memalign) redirected to 0x4c31f60 (posix_memalign)
--34782-- REDIR: 0x6718f50 (libc.so.6:__memset_avx2_unaligned_erms) redirected to 0x4c365d0 (memset)
--34782-- REDIR: 0x6622c30 (libc.so.6:realloc) redirected to 0x4c31cb0 (realloc)
--34782-- REDIR: 0x6718ad0 (libc.so.6:__memcpy_avx_unaligned_erms) redirected to 0x4c366e0 (memmove)
Splitting the commandline.
Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '3'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-i' ... matched as input url with argument 'samples/png/chrome/83fcd9aa47ccb67acd70991b237046d95d1c4467'.
Reading option '-target' ... matched as option 'target' (specify target file type ("vcd", "svcd", "dvd", "dv" or "dv50" with optional prefixes "pal-", "ntsc-" or "film-")) with argument 'vcd'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0'.
Reading option '-c:' ... matched as option 'c' (codec name) with argument 's:10'.
Reading option 'vorbis' ... matched as output url.
Reading option '-disposition:' ... matched as option 'disposition' (disposition) with argument 'v:195'.
Reading option 'dca' ... matched as output url.
Reading option '-aframes' ... matched as option 'aframes' (set the number of audio frames to output) with argument '64'.
Reading option '-ab' ... matched as option 'ab' (audio bitrate (please use -b:a)) with argument '507k'.
Reading option '-ac' ... matched as option 'ac' (set number of audio channels) with argument '22'.
Reading option 'output/tmp.rsd' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option loglevel (set logging level) with argument 99.
Successfully parsed a group of options.
Parsing a group of options: input url samples/png/chrome/83fcd9aa47ccb67acd70991b237046d95d1c4467.
Applying option t (record or transcode "duration" seconds of audio/video) with argument 3.
Successfully parsed a group of options.
Opening an input file: samples/png/chrome/83fcd9aa47ccb67acd70991b237046d95d1c4467.
--34782-- REDIR: 0x6621950 (libc.so.6:free) redirected to 0x4c30cd0 (free)
[NULL @ 0x73a70c0] Opening 'samples/png/chrome/83fcd9aa47ccb67acd70991b237046d95d1c4467' for reading
--34782-- REDIR: 0x6714300 (libc.so.6:__strspn_sse42) redirected to 0x4c37990 (strspn)
--34782-- REDIR: 0x6705950 (libc.so.6:__strcpy_ssse3) redirected to 0x4c32dd0 (strcpy)
[file @ 0x73a7f40] Setting default whitelist 'file,crypto'
Probing apng score:100 size:2048
--34782-- REDIR: 0x67146f0 (libc.so.6:__rawmemchr_avx2) redirected to 0x4c37050 (rawmemchr)
Probing mp3 score:1 size:2048
--34782-- REDIR: 0x6714070 (libc.so.6:__strcspn_sse42) redirected to 0x4c378d0 (strcspn)
--34782-- REDIR: 0x6714ba0 (libc.so.6:__memcmp_avx2_movbe) redirected to 0x4c35e00 (bcmp)
Probing png_pipe score:99 size:2048
[apng @ 0x73a70c0] Format apng probed with size=2048 and score=100
[apng @ 0x73a70c0] num_frames: 50, num_play: 0
[apng @ 0x73a70c0] Before avformat_find_stream_info() pos: 114 bytes read:32768 seeks:0 nb_streams:1
[apng @ 0x73a70c0] decode_fctl_chunk: sequence_number: 0, width: 235, height: 148, x_offset: 0, y_offset: 0, delay_num: 510, delay_den: 1000, dispose_op: 0, blend_op: 0
[apng @ 0x73a70c0] stream 0: start_time: -92233720368547.766 duration: -92233720368547.766
[apng @ 0x73a70c0] format: start_time: -9223372036854.775 duration: -9223372036854.775 bitrate=0 kb/s
[apng @ 0x73a70c0] Could not find codec parameters for stream 0 (Video: apng, 1 reference frame, none(pc), 235x148, 1/100000): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[apng @ 0x73a70c0] After avformat_find_stream_info() pos: 1109 bytes read:32768 seeks:0 frames:0
Input #0, apng, from 'samples/png/chrome/83fcd9aa47ccb67acd70991b237046d95d1c4467':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 0, 1/100000: Video: apng, 1 reference frame, none(pc), 235x148, 0/1, 100k tbr, 100k tbn, 100k tbc
Successfully opened the file.
Parsing a group of options: output url vorbis.
Applying option target (specify target file type ("vcd", "svcd", "dvd", "dv" or "dv50" with optional prefixes "pal-", "ntsc-" or "film-")) with argument vcd.
Could not determine norm (PAL/NTSC/NTSC-Film) for target.
Please prefix target with "pal-", "ntsc-" or "film-",
or set a framerate with "-r xxx".
[AVIOContext @ 0x73b0a40] Statistics: 32768 bytes read, 0 seeks
==34782== 
==34782== HEAP SUMMARY:
==34782==     in use at exit: 1,875 bytes in 27 blocks
==34782==   total heap usage: 152 allocs, 125 frees, 88,492 bytes allocated
==34782== 
==34782== Searching for pointers to 27 not-freed blocks
==34782== Checked 8,825,176 bytes
==34782== 
==34782== 6 bytes in 1 blocks are still reachable in loss record 1 of 20
==34782==    at 0x4C2FA3F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31D84: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF55830: av_strdup (mem.c:256)
==34782==    by 0xF46D37: av_dict_set (dict.c:83)
==34782==    by 0x284BB9: init_parse_context (cmdutils.c:724)
==34782==    by 0x284BB9: split_commandline (cmdutils.c:763)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 6 bytes in 1 blocks are still reachable in loss record 2 of 20
==34782==    at 0x4C2FA3F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31D84: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF55830: av_strdup (mem.c:256)
==34782==    by 0xF46D37: av_dict_set (dict.c:83)
==34782==    by 0x285043: finish_group (cmdutils.c:685)
==34782==    by 0x285043: split_commandline (cmdutils.c:797)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 8 bytes in 1 blocks are still reachable in loss record 3 of 20
==34782==    at 0x4C2FA3F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31D84: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF55830: av_strdup (mem.c:256)
==34782==    by 0xF46CE0: av_dict_set (dict.c:87)
==34782==    by 0x284BB9: init_parse_context (cmdutils.c:724)
==34782==    by 0x284BB9: split_commandline (cmdutils.c:763)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 8 bytes in 1 blocks are still reachable in loss record 4 of 20
==34782==    at 0x4C2FA3F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31D84: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF55830: av_strdup (mem.c:256)
==34782==    by 0xF46CE0: av_dict_set (dict.c:87)
==34782==    by 0x285043: finish_group (cmdutils.c:685)
==34782==    by 0x285043: split_commandline (cmdutils.c:797)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 12 bytes in 2 blocks are still reachable in loss record 5 of 20
==34782==    at 0x4C2FA3F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31D84: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF55830: av_strdup (mem.c:256)
==34782==    by 0xF46D37: av_dict_set (dict.c:83)
==34782==    by 0x284CD7: finish_group (cmdutils.c:685)
==34782==    by 0x284CD7: split_commandline (cmdutils.c:779)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 16 bytes in 1 blocks are still reachable in loss record 6 of 20
==34782==    at 0x4C31E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF55582: av_malloc (mem.c:87)
==34782==    by 0xF55788: av_mallocz (mem.c:238)
==34782==    by 0xF46CF8: av_dict_set (dict.c:89)
==34782==    by 0x284BB9: init_parse_context (cmdutils.c:724)
==34782==    by 0x284BB9: split_commandline (cmdutils.c:763)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 16 bytes in 1 blocks are still reachable in loss record 7 of 20
==34782==    at 0x4C2FA3F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31D84: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF46D79: av_dict_set (dict.c:106)
==34782==    by 0x284BB9: init_parse_context (cmdutils.c:724)
==34782==    by 0x284BB9: split_commandline (cmdutils.c:763)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 16 bytes in 1 blocks are still reachable in loss record 8 of 20
==34782==    at 0x4C31E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF55582: av_malloc (mem.c:87)
==34782==    by 0xF55788: av_mallocz (mem.c:238)
==34782==    by 0xF46CF8: av_dict_set (dict.c:89)
==34782==    by 0x285043: finish_group (cmdutils.c:685)
==34782==    by 0x285043: split_commandline (cmdutils.c:797)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 16 bytes in 1 blocks are still reachable in loss record 9 of 20
==34782==    at 0x4C2FA3F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31D84: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF46D79: av_dict_set (dict.c:106)
==34782==    by 0x285043: finish_group (cmdutils.c:685)
==34782==    by 0x285043: split_commandline (cmdutils.c:797)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 16 bytes in 2 blocks are still reachable in loss record 10 of 20
==34782==    at 0x4C2FA3F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31D84: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF55830: av_strdup (mem.c:256)
==34782==    by 0xF46CE0: av_dict_set (dict.c:87)
==34782==    by 0x284CD7: finish_group (cmdutils.c:685)
==34782==    by 0x284CD7: split_commandline (cmdutils.c:779)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 32 bytes in 2 blocks are still reachable in loss record 11 of 20
==34782==    at 0x4C31E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF55582: av_malloc (mem.c:87)
==34782==    by 0xF55788: av_mallocz (mem.c:238)
==34782==    by 0xF46CF8: av_dict_set (dict.c:89)
==34782==    by 0x284CD7: finish_group (cmdutils.c:685)
==34782==    by 0x284CD7: split_commandline (cmdutils.c:779)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 32 bytes in 2 blocks are still reachable in loss record 12 of 20
==34782==    at 0x4C2FA3F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31D84: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF46D79: av_dict_set (dict.c:106)
==34782==    by 0x284CD7: finish_group (cmdutils.c:685)
==34782==    by 0x284CD7: split_commandline (cmdutils.c:779)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 40 bytes in 1 blocks are indirectly lost in loss record 13 of 20
==34782==    at 0x4C31E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF55582: av_malloc (mem.c:87)
==34782==    by 0xF55788: av_mallocz (mem.c:238)
==34782==    by 0xF43B3C: av_buffer_create (buffer.c:35)
==34782==    by 0xF43C48: av_buffer_alloc (buffer.c:76)
==34782==    by 0x5F29C4: av_grow_packet (avpacket.c:139)
==34782==    by 0x580299: append_packet_chunked (utils.c:289)
==34782==    by 0x44D30B: apng_read_packet (apngdec.c:370)
==34782==    by 0x584EFD: ff_read_packet (utils.c:855)
==34782==    by 0x585AFB: read_frame_internal (utils.c:1581)
==34782==    by 0x5879C3: avformat_find_stream_info (utils.c:3785)
==34782== 
==34782== 48 bytes in 1 blocks are still reachable in loss record 14 of 20
==34782==    at 0x4C31E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF55582: av_malloc (mem.c:87)
==34782==    by 0xF55788: av_mallocz (mem.c:238)
==34782==    by 0x284B66: init_parse_context (cmdutils.c:714)
==34782==    by 0x284B66: split_commandline (cmdutils.c:763)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 48 bytes in 2 blocks are still reachable in loss record 15 of 20
==34782==    at 0x4C2FA3F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31D84: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x2844B4: grow_array (cmdutils.c:2170)
==34782==    by 0x285161: add_opt (cmdutils.c:699)
==34782==    by 0x285161: split_commandline (cmdutils.c:815)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 72 bytes in 1 blocks are still reachable in loss record 16 of 20
==34782==    at 0x4C2FA3F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31D84: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x2844B4: grow_array (cmdutils.c:2170)
==34782==    by 0x284F8F: finish_group (cmdutils.c:668)
==34782==    by 0x284F8F: split_commandline (cmdutils.c:797)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 192 bytes in 3 blocks are still reachable in loss record 17 of 20
==34782==    at 0x4C31D2F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x2844B4: grow_array (cmdutils.c:2170)
==34782==    by 0x285161: add_opt (cmdutils.c:699)
==34782==    by 0x285161: split_commandline (cmdutils.c:815)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 216 bytes in 1 blocks are still reachable in loss record 18 of 20
==34782==    at 0x4C31D2F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x2844B4: grow_array (cmdutils.c:2170)
==34782==    by 0x284C23: finish_group (cmdutils.c:668)
==34782==    by 0x284C23: split_commandline (cmdutils.c:779)
==34782==    by 0x277FD0: ffmpeg_parse_options (ffmpeg_opt.c:3299)
==34782==    by 0x2706B1: main (ffmpeg.c:4872)
==34782== 
==34782== 1,051 bytes in 1 blocks are indirectly lost in loss record 19 of 20
==34782==    at 0x4C31E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF55582: av_malloc (mem.c:87)
==34782==    by 0xF43C28: av_buffer_alloc (buffer.c:72)
==34782==    by 0x5F29C4: av_grow_packet (avpacket.c:139)
==34782==    by 0x580299: append_packet_chunked (utils.c:289)
==34782==    by 0x44D30B: apng_read_packet (apngdec.c:370)
==34782==    by 0x584EFD: ff_read_packet (utils.c:855)
==34782==    by 0x585AFB: read_frame_internal (utils.c:1581)
==34782==    by 0x5879C3: avformat_find_stream_info (utils.c:3785)
==34782==    by 0x276197: open_input_file (ffmpeg_opt.c:1127)
==34782==    by 0x278101: open_files (ffmpeg_opt.c:3277)
==34782==    by 0x278101: ffmpeg_parse_options (ffmpeg_opt.c:3317)
==34782== 
==34782== 1,115 (24 direct, 1,091 indirect) bytes in 1 blocks are definitely lost in loss record 20 of 20
==34782==    at 0x4C31E76: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0x4C31F91: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==34782==    by 0xF55582: av_malloc (mem.c:87)
==34782==    by 0xF55788: av_mallocz (mem.c:238)
==34782==    by 0xF43B74: av_buffer_create (buffer.c:49)
==34782==    by 0xF43C48: av_buffer_alloc (buffer.c:76)
==34782==    by 0x5F29C4: av_grow_packet (avpacket.c:139)
==34782==    by 0x580299: append_packet_chunked (utils.c:289)
==34782==    by 0x44D30B: apng_read_packet (apngdec.c:370)
==34782==    by 0x584EFD: ff_read_packet (utils.c:855)
==34782==    by 0x585AFB: read_frame_internal (utils.c:1581)
==34782==    by 0x5879C3: avformat_find_stream_info (utils.c:3785)
==34782== 
==34782== LEAK SUMMARY:
==34782==    definitely lost: 24 bytes in 1 blocks
==34782==    indirectly lost: 1,091 bytes in 2 blocks
==34782==      possibly lost: 0 bytes in 0 blocks
==34782==    still reachable: 760 bytes in 24 blocks
==34782==         suppressed: 0 bytes in 0 blocks
==34782== 
==34782== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==34782== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Last edited 5 years ago by Suhwan (previous) (diff)

by Suhwan, 5 years ago

poc

comment:3 by James, 5 years ago

Component: undeterminedavformat
Reproduced by developer: set
Status: reopenedopen
Summary: memory leaks from mem.cmemory leaks in ff_read_packet()

This one i could reproduce.

comment:4 by mkver, 5 years ago

The originally reported memleaks were fixed in 34bd293b014efc816bd7aab068d7f9e4a6d3011a; so it's no wonder that James can't reproduce the memleaks.
I have also proposed a fix for the null pointer problem (see here) and wanted to close this ticket when it's merged.
I'll look at your new sample later.

PS: I couldn't reproduce the uninitialised reads at all (just as I couldn't do so with #8122).

comment:5 by mkver, 5 years ago

The null pointer problem has been fixed in e6018fda14d7cfe2c890fb336c9264c4ea0b6c5c.

comment:6 by James, 5 years ago

Resolution: fixed
Status: openclosed

Leak from comment 2 fixed in bae8844e35147f92e612a9e0b44e939a293e5bc9.

Note: See TracTickets for help on using tickets.