[FFmpeg-trac] #5139(undetermined:new): memory leak when invalid data is found processing input

FFmpeg trac at avcodec.org
Thu Jan 7 18:57:39 CET 2016


#5139: memory leak when invalid data is found processing input
-------------------------------------+-------------------------------------
             Reporter:  tsmith       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 Memory leak of 960 bytes

 How to reproduce:
 {{{
 % ffmpeg -i input ... output
 ==4985== Memcheck, a memory error detector
 ==4985== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
 ==4985== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright
 info
 ==4985== Command: ./ffmpeg_clean -f ivf -i
 ivf_corpus/13074d77d64a80773038b64b8542e10295089d81 -f null -
 ==4985==
 ffmpeg version N-77718-g72673ad Copyright (c) 2000-2016 the FFmpeg
 developers
   built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
   configuration: --cc=gcc --cxx=g++ --disable-libxcb --disable-xlib
 --disable-logging --disable-ffprobe --disable-ffplay --disable-sdl
 --disable-ffserver --disable-doc --disable-pthreads --disable-network
 --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vda --disable-
 vdpau --disable-stripping --disable-runtime-cpudetect --disable-
 securetransport --disable-iconv
   libavutil      55. 12.100 / 55. 12.100
   libavcodec     57. 22.100 / 57. 22.100
   libavformat    57. 21.101 / 57. 21.101
   libavdevice    57.  0.100 / 57.  0.100
   libavfilter     6. 23.100 /  6. 23.100
   libswscale      4.  0.100 /  4.  0.100
   libswresample   2.  0.101 /  2.  0.101
 st:0 has too large timebase, reducing
 [h264 @ 0x624efa0] Warning: not compiled with thread support, using thread
 emulation
 Truncating packet of size 1175257088 to 34917
 [h264 @ 0x624efa0] sps_id 32 out of range
 [h264 @ 0x624efa0] FMO not supported
 [h264 @ 0x624efa0] sps_id 32 out of range
     Last message repeated 1 times
 [h264 @ 0x624efa0] Truncating likely oversized SPS
 [h264 @ 0x624efa0] sps_id 32 out of range
     Last message repeated 1 times
 [h264 @ 0x624efa0] FMO not supported
 [h264 @ 0x624efa0] sps_id 32 out of range
 [h264 @ 0x624efa0] Truncating likely oversized SPS
 [h264 @ 0x624efa0] sps_id 32 out of range
     Last message repeated 1 times
 [h264 @ 0x624efa0] Missing reference picture, default is 0
     Last message repeated 2 times
 [h264 @ 0x624efa0] co located POCs unavailable
 [h264 @ 0x624efa0] error while decoding MB 86 3, bytestream -11
 [h264 @ 0x624efa0] non-existing SPS 0 referenced in buffering period
 [h264 @ 0x624efa0] number of reference frames (0+3) exceeds max (2;
 probably corrupt input), discarding one
 [h264 @ 0x624efa0] concealing 258 DC, 258 AC, 258 MV errors in B frame
 [ivf @ 0x6245780] decoding for stream 0 failed
 Input #0, ivf, from 'ivf_corpus/13074d77d64a80773038b64b8542e10295089d81':
   Duration: -404950:-11:-49.57, bitrate: N/A
     Stream #0:0: Video: h264 (CAVLC 4:4:4) (V264 / 0x34363256), yuv444p,
 1566x94, 278.66 tbr, 278.66 tbn, 557.33 tbc
 [wrapped_avframe @ 0x65c6560] Warning: not compiled with thread support,
 using thread emulation
 [h264 @ 0x658fb20] Warning: not compiled with thread support, using thread
 emulation
 Output #0, null, to 'pipe:':
     Stream #0:0: Video: wrapped_avframe, yuv444p, 1566x94, q=2-31, 200
 kb/s, 278.66 fps, 278.66 tbn, 278.66 tbc
     Metadata:
       encoder         : Lavc57.22.100 wrapped_avframe
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
 Error while opening decoder for input stream #0:0 : Invalid data found
 when processing input
 ==4985==
 ==4985== HEAP SUMMARY:
 ==4985==     in use at exit: 960 bytes in 2 blocks
 ==4985==   total heap usage: 1,246 allocs, 1,244 frees, 4,215,316 bytes
 allocated
 ==4985==
 ==4985== 480 bytes in 1 blocks are definitely lost in loss record 1 of 2
 ==4985==    at 0x4C2D110: memalign (in /usr/lib/valgrind
 /vgpreload_memcheck-amd64-linux.so)
 ==4985==    by 0x4C2D227: posix_memalign (in /usr/lib/valgrind
 /vgpreload_memcheck-amd64-linux.so)
 ==4985==    by 0xE3E89F: av_malloc (mem.c:97)
 ==4985==    by 0xE3E89F: av_mallocz (mem.c:254)
 ==4985==    by 0xE380AA: av_frame_alloc (frame.c:143)
 ==4985==    by 0x4230D1: h264_init_context (h264.c:635)
 ==4985==    by 0x4230D1: ff_h264_decode_init (h264.c:656)
 ==4985==    by 0xA29703: avcodec_open2 (utils.c:1483)
 ==4985==    by 0x48E1F8: init_input_stream (ffmpeg.c:2542)
 ==4985==    by 0x48E1F8: transcode_init (ffmpeg.c:3200)
 ==4985==    by 0x471163: transcode (ffmpeg.c:4093)
 ==4985==    by 0x471163: main (ffmpeg.c:4314)
 ==4985==
 ==4985== 480 bytes in 1 blocks are definitely lost in loss record 2 of 2
 ==4985==    at 0x4C2D110: memalign (in /usr/lib/valgrind
 /vgpreload_memcheck-amd64-linux.so)
 ==4985==    by 0x4C2D227: posix_memalign (in /usr/lib/valgrind
 /vgpreload_memcheck-amd64-linux.so)
 ==4985==    by 0xE3E89F: av_malloc (mem.c:97)
 ==4985==    by 0xE3E89F: av_mallocz (mem.c:254)
 ==4985==    by 0xE380AA: av_frame_alloc (frame.c:143)
 ==4985==    by 0x4230E6: h264_init_context (h264.c:639)
 ==4985==    by 0x4230E6: ff_h264_decode_init (h264.c:656)
 ==4985==    by 0xA29703: avcodec_open2 (utils.c:1483)
 ==4985==    by 0x48E1F8: init_input_stream (ffmpeg.c:2542)
 ==4985==    by 0x48E1F8: transcode_init (ffmpeg.c:3200)
 ==4985==    by 0x471163: transcode (ffmpeg.c:4093)
 ==4985==    by 0x471163: main (ffmpeg.c:4314)
 ==4985==
 ==4985== LEAK SUMMARY:
 ==4985==    definitely lost: 960 bytes in 2 blocks
 ==4985==    indirectly lost: 0 bytes in 0 blocks
 ==4985==      possibly lost: 0 bytes in 0 blocks
 ==4985==    still reachable: 0 bytes in 0 blocks
 ==4985==         suppressed: 0 bytes in 0 blocks
 ==4985==
 ==4985== For counts of detected and suppressed errors, rerun with: -v
 ==4985== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5139>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list