[FFmpeg-trac] #1335(avcodec:new): Memleak when reading corrupted cavs video

FFmpeg trac at avcodec.org
Mon May 21 10:38:06 CEST 2012


#1335: Memleak when reading corrupted cavs video
-------------------------------------+-------------------------------------
               Reporter:  cehoyos    |                  Owner:
                   Type:  defect     |                 Status:  new
               Priority:  normal     |              Component:  avcodec
                Version:  git-       |               Keywords:  memleak
  master                             |  cavs
             Blocked By:             |               Blocking:
Reproduced by developer:  0          |  Analyzed by developer:  0
-------------------------------------+-------------------------------------
 (Sample from issue 2180)
 {{{
 $ valgrind --leak-check=full ./ffmpeg_g -i cavs_cut.avs
 ==31642== Memcheck, a memory error detector.
 ==31642== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
 ==31642== Using LibVEX rev 1732, a library for dynamic binary translation.
 ==31642== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
 ==31642== Using valgrind-3.2.3, a dynamic binary instrumentation
 framework.
 ==31642== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
 ==31642== For more details, rerun with: -v
 ==31642==
 ffmpeg version N-40924-g349c624 Copyright (c) 2000-2012 the FFmpeg
 developers
   built on May 21 2012 10:01:24 with gcc 4.3.2
   configuration: --cc=/usr/local/gcc-4.3.2/bin/gcc --disable-optimizations
   libavutil      51. 53.100 / 51. 53.100
   libavcodec     54. 21.101 / 54. 21.101
   libavformat    54.  5.101 / 54.  5.101
   libavdevice    53.  4.100 / 53.  4.100
   libavfilter     2. 75.100 /  2. 75.100
   libswscale      2.  1.100 /  2.  1.100
   libswresample   0. 15.100 /  0. 15.100
 Truncating packet of size 2012 to 13
 [cavs @ 0x4430480] Found 1 unreleased buffers!
 Truncating packet of size 2012 to 13
 Input #0, mpeg, from 'cavs_cut.avs':
   Duration: 00:00:01.20, start: 0.220000, bitrate: 1761 kb/s
     Stream #0:0[0x1e0]: Video: cavs, yuv420p, 720x576, 25 fps, 25 tbr, 90k
 tbn, 25 tbc
     Stream #0:1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 160 kb/s
 At least one output file must be specified
 ==31642==
 ==31642== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 3 from 1)
 ==31642== malloc/free: in use at exit: 307,476 bytes in 9 blocks.
 ==31642== malloc/free: 553 allocs, 544 frees, 2,340,145 bytes allocated.
 ==31642== For counts of detected errors, rerun with: -v
 ==31642== searching for pointers to 9 not-freed blocks.
 ==31642== checked 6,440,056 bytes.
 ==31642==
 ==31642== 138,940 bytes in 7 blocks are definitely lost in loss record 1
 of 2
 ==31642==    at 0x4021A50: memalign (in
 /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
 ==31642==    by 0x4021AAA: posix_memalign (in
 /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
 ==31642==    by 0x875B1CE: av_malloc (mem.c:95)
 ==31642==    by 0x875B349: av_mallocz (mem.c:187)
 ==31642==    by 0x842FD83: ff_MPV_common_init (mpegvideo.c:734)
 ==31642==    by 0x8235C39: decode_pic (cavsdec.c:477)
 ==31642==    by 0x8236EC4: cavs_decode_frame (cavsdec.c:704)
 ==31642==    by 0x852E22D: avcodec_decode_video2 (utils.c:1464)
 ==31642==    by 0x81BF16B: try_decode_frame (utils.c:2313)
 ==31642==    by 0x81C05F8: avformat_find_stream_info (utils.c:2629)
 ==31642==    by 0x805A4A1: opt_input_file (ffmpeg.c:4337)
 ==31642==    by 0x80610E0: parse_option (cmdutils.c:305)
 ==31642==
 ==31642==
 ==31642== 168,536 bytes in 2 blocks are possibly lost in loss record 2 of
 2
 ==31642==    at 0x4021A50: memalign (in
 /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
 ==31642==    by 0x4021AAA: posix_memalign (in
 /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
 ==31642==    by 0x875B1CE: av_malloc (mem.c:95)
 ==31642==    by 0x875B349: av_mallocz (mem.c:187)
 ==31642==    by 0x8430539: ff_MPV_common_init (mpegvideo.c:781)
 ==31642==    by 0x8235C39: decode_pic (cavsdec.c:477)
 ==31642==    by 0x8236EC4: cavs_decode_frame (cavsdec.c:704)
 ==31642==    by 0x852E22D: avcodec_decode_video2 (utils.c:1464)
 ==31642==    by 0x81BF16B: try_decode_frame (utils.c:2313)
 ==31642==    by 0x81C05F8: avformat_find_stream_info (utils.c:2629)
 ==31642==    by 0x805A4A1: opt_input_file (ffmpeg.c:4337)
 ==31642==    by 0x80610E0: parse_option (cmdutils.c:305)
 ==31642==
 ==31642== LEAK SUMMARY:
 ==31642==    definitely lost: 138,940 bytes in 7 blocks.
 ==31642==      possibly lost: 168,536 bytes in 2 blocks.
 ==31642==    still reachable: 0 bytes in 0 blocks.
 ==31642==         suppressed: 0 bytes in 0 blocks.
 }}}

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


More information about the FFmpeg-trac mailing list