[FFmpeg-trac] #2088(avcodec:open): crash with forced aac and h264

FFmpeg trac at avcodec.org
Tue Jan 1 22:50:24 CET 2013


#2088: crash with forced aac and h264
------------------------------------+-----------------------------------
             Reporter:  ami_stuff   |                    Owner:
                 Type:  defect      |                   Status:  open
             Priority:  normal      |                Component:  avcodec
              Version:  git-master  |               Resolution:
             Keywords:  h264 leak   |               Blocked By:
             Blocking:              |  Reproduced by developer:  1
Analyzed by developer:  0           |
------------------------------------+-----------------------------------
Changes (by cehoyos):

 * keywords:  h264 => h264 leak


Comment:

 The following produces a memleak, not reproducible with -threads 1 (and
 not without actual decoding):
 {{{
 $ valgrind ./ffmpeg_g -vcodec h264 -threads 2 -i dvdsub.vob -f null -
 ==7255== Memcheck, a memory error detector
 ==7255== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
 ==7255== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
 ==7255== Command: ffmpeg_g -vcodec h264 -threads 2 -i dvdsub.vob -f null -
 ==7255==
 ffmpeg version N-48385-g5ed5e90 Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Jan  1 2013 21:30:44 with gcc 4.7 (SUSE Linux)
   configuration: --enable-gpl --disable-indev=jack
   libavutil      52. 13.100 / 52. 13.100
   libavcodec     54. 85.100 / 54. 85.100
   libavformat    54. 59.100 / 54. 59.100
   libavdevice    54.  3.102 / 54.  3.102
   libavfilter     3. 30.102 /  3. 30.102
   libswscale      2.  1.103 /  2.  1.103
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  2.100 / 52.  2.100
 ==7255== Invalid read of size 4
 ==7255==    at 0x77E289: avpriv_h264_has_num_reorder_frames (h264.c:80)
 ==7255==    by 0x5951BC: try_decode_frame (utils.c:906)
 ==7255==    by 0x59C755: avformat_find_stream_info (utils.c:2889)
 ==7255==    by 0x454C80: open_input_file (ffmpeg_opt.c:794)
 ==7255==    by 0x45349F: open_files.isra.6 (ffmpeg_opt.c:2295)
 ==7255==    by 0x458E48: ffmpeg_parse_options (ffmpeg_opt.c:2332)
 ==7255==    by 0x451377: main (ffmpeg.c:3185)
 ==7255==  Address 0x68afcd4 is 1,396 bytes inside a block of size 2,048
 free'd
 ==7255==    at 0x4C29D4E: free (in /usr/lib64/valgrind/vgpreload_memcheck-
 amd64-linux.so)
 ==7255==    by 0xBB7FBB: av_freep (mem.c:185)
 ==7255==    by 0x5DCEE3: ff_init_vlc_sparse (bitstream.c:338)
 ==7255==    by 0x423E78: ff_mpeg12_init_vlcs (mpeg12.c:690)
 ==7255==    by 0x4242BF: mpeg_decode_init (mpeg12.c:1150)
 ==7255==    by 0x9A0FC5: avcodec_open2 (utils.c:1030)
 ==7255==    by 0x595269: try_decode_frame (utils.c:2453)
 ==7255==    by 0x59C755: avformat_find_stream_info (utils.c:2889)
 ==7255==    by 0x454C80: open_input_file (ffmpeg_opt.c:794)
 ==7255==    by 0x45349F: open_files.isra.6 (ffmpeg_opt.c:2295)
 ==7255==    by 0x458E48: ffmpeg_parse_options (ffmpeg_opt.c:2332)
 ==7255==    by 0x451377: main (ffmpeg.c:3185)
 ==7255==
 [mpeg @ 0x66c6fe0] max_analyze_duration 5000000 reached at 5000000
 ==7255== Invalid read of size 4
 ==7255==    at 0x77E289: avpriv_h264_has_num_reorder_frames (h264.c:80)
 ==7255==    by 0x5951BC: try_decode_frame (utils.c:906)
 ==7255==    by 0x59DB02: avformat_find_stream_info (utils.c:2909)
 ==7255==    by 0x454C80: open_input_file (ffmpeg_opt.c:794)
 ==7255==    by 0x45349F: open_files.isra.6 (ffmpeg_opt.c:2295)
 ==7255==    by 0x458E48: ffmpeg_parse_options (ffmpeg_opt.c:2332)
 ==7255==    by 0x451377: main (ffmpeg.c:3185)
 ==7255==  Address 0x68afcd4 is 1,396 bytes inside a block of size 2,048
 free'd
 ==7255==    at 0x4C29D4E: free (in /usr/lib64/valgrind/vgpreload_memcheck-
 amd64-linux.so)
 ==7255==    by 0xBB7FBB: av_freep (mem.c:185)
 ==7255==    by 0x5DCEE3: ff_init_vlc_sparse (bitstream.c:338)
 ==7255==    by 0x423E78: ff_mpeg12_init_vlcs (mpeg12.c:690)
 ==7255==    by 0x4242BF: mpeg_decode_init (mpeg12.c:1150)
 ==7255==    by 0x9A0FC5: avcodec_open2 (utils.c:1030)
 ==7255==    by 0x595269: try_decode_frame (utils.c:2453)
 ==7255==    by 0x59C755: avformat_find_stream_info (utils.c:2889)
 ==7255==    by 0x454C80: open_input_file (ffmpeg_opt.c:794)
 ==7255==    by 0x45349F: open_files.isra.6 (ffmpeg_opt.c:2295)
 ==7255==    by 0x458E48: ffmpeg_parse_options (ffmpeg_opt.c:2332)
 ==7255==    by 0x451377: main (ffmpeg.c:3185)
 ==7255==
 Input #0, mpeg, from 'dvdsub.vob':
   Duration: 00:00:07.97, start: 1556.319267, bitrate: 5263 kb/s
     Stream #0:0[0x1e0]: Video: h264, yuv420p, 720x576 [SAR 64:45 DAR
 16:9], 25 fps, 1.67 tbr, 90k tbn, 50 tbc
     Stream #0:1[0x80]: Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
     Stream #0:2[0x20]: Subtitle: dvd_subtitle
     Stream #0:3[0x22]: Subtitle: dvd_subtitle
     Stream #0:4[0x24]: Subtitle: dvd_subtitle
     Stream #0:5[0x25]: Subtitle: dvd_subtitle
     Stream #0:6[0x26]: Subtitle: dvd_subtitle
     Stream #0:7[0x28]: Subtitle: dvd_subtitle
     Stream #0:8[0x29]: Subtitle: dvd_subtitle
     Stream #0:9[0x21]: Subtitle: dvd_subtitle
     Stream #0:10[0x23]: Subtitle: dvd_subtitle
     Stream #0:11[0x27]: Subtitle: dvd_subtitle
     Stream #0:12[0x2a]: Subtitle: dvd_subtitle
 [h264 @ 0x742c480] Ignoring NAL 19 in global header/extradata
 Output #0, null, to 'pipe:':
   Metadata:
     encoder         : Lavf54.59.100
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x576
 [SAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 1.67 tbc
     Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 -> rawvideo)
   Stream #0:1 -> #0:1 (ac3 -> pcm_s16le)
 Press [q] to stop, [?] for help
 [h264 @ 0x66e1300] Ignoring NAL 19 in global header/extradata
 [h264 @ 0x66e1300] non-existing PPS referenced
 [h264 @ 0x742c480] non-existing PPS 2 referenced
 [h264 @ 0x742c480] decode_slice_header error
 [h264 @ 0x742c480] no frame!

 ...

 Error while decoding stream #0:0: Operation not permitted
 [ac3 @ 0x69b98a0] incomplete frame
 Input stream #0:0 frame changed from size:720x576 fmt:yuv420p to
 size:150x8 fmt:yuv420p
 [null @ 0x72d36e0] Encoder did not produce proper pts, making some up.
 frame=   15 fps=4.1 q=0.0 size=N/A time=00:00:07.87 bitrate=N/A dup=14
 drop=0    ^Mframe=   15 fps=4.1 q=0.0 Lsize=N/A time=00:00:09.00
 bitrate=N/A dup=14 drop=0
 video:1kB audio:1476kB subtitle:0 global headers:0kB muxing overhead
 -100.001454%
 ==7255==
 ==7255== HEAP SUMMARY:
 ==7255==     in use at exit: 212,240,756 bytes in 760 blocks
 ==7255==   total heap usage: 23,505 allocs, 22,745 frees, 261,093,140
 bytes allocated
 ==7255==
 ==7255== LEAK SUMMARY:
 ==7255==    definitely lost: 211,124,240 bytes in 756 blocks
 ==7255==    indirectly lost: 558,316 bytes in 2 blocks
 ==7255==      possibly lost: 558,200 bytes in 2 blocks
 ==7255==    still reachable: 0 bytes in 0 blocks
 ==7255==         suppressed: 0 bytes in 0 blocks
 ==7255== Rerun with --leak-check=full to see details of leaked memory
 ==7255==
 ==7255== For counts of detected and suppressed errors, rerun with: -v
 ==7255== ERROR SUMMARY: 119 errors from 2 contexts (suppressed: 2 from 2)
 }}}

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2088#comment:3>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list