Opened 5 years ago

Closed 5 years ago

#2242 closed defect (fixed)

Small memory leak when using -fix_sub_duration with ass -> mov_text

Reported by: cehoyos Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: ass leak
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I originally reproduced the memleak with the sample from ticket #2213

$ valgrind --leak-check=full ffmpeg_g -fix_sub_duration -i ass.mkv -map 0 -scodec mov_text out.mp4
==23764== Memcheck, a memory error detector
==23764== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==23764== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==23764== Command: ffmpeg_g -fix_sub_duration -i ass.mkv -map 0 -scodec mov_text out.mp4
==23764==
ffmpeg version N-49616-gf0eacbc Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb  5 2013 23:36:50 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.100 / 54. 91.100
  libavformat    54. 61.104 / 54. 61.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 35.101 /  3. 35.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Input #0, matroska,webm, from 'ass.mkv':
  Metadata:
    ENCODER         : Lavf54.61.104
  Duration: 00:24:20.02, start: 0.000000, bitrate: 1 kb/s
    Stream #0:0: Subtitle: ssa (default)
    Stream #0:1: Subtitle: ssa
    Stream #0:2: Subtitle: ssa
Output #0, mp4, to 'out.mp4':
  Metadata:
    encoder         : Lavf54.61.104
    Stream #0:0: Subtitle: mov_text ([8][0][0][0] / 0x0008) (default)
    Stream #0:1: Subtitle: mov_text ([8][0][0][0] / 0x0008)
    Stream #0:2: Subtitle: mov_text ([8][0][0][0] / 0x0008)
Stream mapping:
  Stream #0:0 -> #0:0 (ass -> mov_text)
  Stream #0:1 -> #0:1 (ass -> mov_text)
  Stream #0:2 -> #0:2 (ass -> mov_text)
Press [q] to stop, [?] for help
size=     140kB time=00:24:07.25 bitrate=   0.8kbits/s
video:0kB audio:0kB subtitle:114 global headers:0kB muxing overhead 23.206204%
==23764==
==23764== HEAP SUMMARY:
==23764==     in use at exit: 781 bytes in 9 blocks
==23764==   total heap usage: 32,689 allocs, 32,680 frees, 9,646,724 bytes allocated
==23764==
==23764== 781 (24 direct, 757 indirect) bytes in 3 blocks are definitely lost in loss record 3 of 3
==23764==    at 0x4C2ABED: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23764==    by 0x4C2AD6F: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==23764==    by 0xAAAD00: ff_ass_add_rect (ass.c:95)
==23764==    by 0x5CE048: ass_decode_frame (assdec.c:56)
==23764==    by 0x99D11E: avcodec_decode_subtitle2 (utils.c:1846)
==23764==    by 0x45D50E: transcode_subtitles (ffmpeg.c:1734)
==23764==    by 0x45EE89: process_input (ffmpeg.c:1855)
==23764==    by 0x44ECBF: main (ffmpeg.c:3084)
==23764==
==23764== LEAK SUMMARY:
==23764==    definitely lost: 24 bytes in 3 blocks
==23764==    indirectly lost: 757 bytes in 6 blocks
==23764==      possibly lost: 0 bytes in 0 blocks
==23764==    still reachable: 0 bytes in 0 blocks
==23764==         suppressed: 0 bytes in 0 blocks
==23764==
==23764== For counts of detected and suppressed errors, rerun with: -v
==23764== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 2 from 2)

Attachments (1)

ass.mkv (229.5 KB) - added by cehoyos 5 years ago.

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by cehoyos

comment:1 Changed 5 years ago by cehoyos

  • Resolution set to fixed
  • Status changed from new to closed

Fixed by Nicolas.

Note: See TracTickets for help on using tickets.