[FFmpeg-devel] [RFC] Possible memleak in mpegts demuxer on some malformed mpegts files with too large pes packets

Carl Eugen Hoyos cehoyos at ag.or.at
Wed Apr 17 11:46:02 CEST 2013


Lars Hammarstrand <lars.hammarstrand <at> gmail.com> writes:

> > Could you provide a sample?
> >
> you should have a sample "brokenCut_issue899.ts" 
> from a previous case:

http://thread.gmane.org/gmane.comp.video.ffmpeg.issues/12460
This was fixed in November 2010 and is not reproducible 
with current git head.
Which version did you test?

Carl Eugen

$ valgrind ffmpeg_g -i brokenCut_issue899.ts -f null -
==21768== Memcheck, a memory error detector
==21768== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==21768== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==21768== Command: /ffmpeg_g -i brokenCut_issue899.ts -f null -
==21768==
ffmpeg version N-52170-ge564431 Copyright (c) 2000-2013 the FFmpeg developers
  built on Apr 17 2013 11:44:05 with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl --disable-indev=jack
  libavutil      52. 26.100 / 52. 26.100
  libavcodec     55.  2.100 / 55.  2.100
  libavformat    55.  2.100 / 55.  2.100
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 56.101 /  3. 56.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[mpegts @ 0x64a7b00] PES packet size mismatch
    Last message repeated 1 times
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
    Last message repeated 1 times
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
    Last message repeated 1 times
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
    Last message repeated 2 times
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
    Last message repeated 1 times
[mpeg2video @ 0x64cec00] Invalid frame dimensions 0x0.
[mpegts @ 0x64a7b00] PES packet size mismatch
    Last message repeated 123 times
[mpegts @ 0x64a7b00] max_analyze_duration 5000000 reached at 5016000
microseconds
[mpegts @ 0x64a7b00] Could not find codec parameters for stream 2 (Unknown:
none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[NULL @ 0x65046c0] start time is not set in estimate_timings_from_pts
[mpegts @ 0x64a7b00] PES packet size mismatch
    Last message repeated 14 times
Input #0, mpegts, from 'brokenCut_issue899.ts':
  Duration: 00:00:30.64, start: 40354.429344, bitrate: 5346 kb/s
  Program 17502
    Stream #0:0[0x2ff]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
yuv420p, 720x576 [SAR 16:15 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x300](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz,
stereo, s16p, 192 kb/s (clean effects)
  No Program
    Stream #0:2[0x666]: Unknown: none
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf55.2.100
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x576 [SAR
16:15 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 25 tbc
    Stream #0:1(deu): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
(clean effects)
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> rawvideo)
  Stream #0:1 -> #0:1 (mp2 -> pcm_s16le)
Press [q] to stop, [?] for help
[null @ 0x7084d40] Encoder did not produce proper pts, making some up.
PES packet size mismatch0 size=N/A time=00:00:30.40 bitrate=N/A dup=17 drop=0
[mpeg2video @ 0x64cec00] ac-tex damaged at 20 24
[mpeg2video @ 0x64cec00] Warning MVs not available
[mpeg2video @ 0x64cec00] concealing 540 DC, 540 AC, 540 MV errors in P frame
[mp2 @ 0x64cf7c0] incomplete frame
Error while decoding stream #0:1: Invalid data found when processing input
frame=  767 fps= 10 q=0.0 Lsize=N/A time=00:00:30.68 bitrate=N/A dup=19 drop=0
video:72kB audio:5706kB subtitle:0 global headers:0kB muxing overhead
-100.000372%
==21768==
==21768== HEAP SUMMARY:
==21768==     in use at exit: 0 bytes in 0 blocks
==21768==   total heap usage: 69,556 allocs, 69,556 frees, 247,863,139 bytes
allocated
==21768==
==21768== All heap blocks were freed -- no leaks are possible
==21768==
==21768== For counts of detected and suppressed errors, rerun with: -v
==21768== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)



More information about the ffmpeg-devel mailing list