Opened 14 years ago
Closed 14 years ago
#21 closed defect (fixed)
Segfault converting m2t file with ac3 audio track when number of audio channels changes.
Reported by: | Rodney Baker | Owned by: | Michael Niedermayer |
---|---|---|---|
Priority: | critical | Component: | ffmpeg |
Version: | git | Keywords: | crash, segfault, invalid pointer |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
When converting an m2t file with a 5.1 channel ac3 audio track to mkv, ffmpeg segfaults when the number of audio channels in the source stream changes. The source stream was recorded from DVB and during an ad break changes from 5.1ch audio to 2ch audio (and presumably back again at the end of the adverts). The command line used was:
ffmpeg -y -i Summernats\ 2011.m2t -pass 2 -acodec ac3 -ab 512k -vcodec libx264 -vpre slow -vpre baseline -threads 0 -vsync 1 -b 2048k -bt 2048k -nr 400 -aspect 16:9 -s 1440x1080 -sn Summernats\ 2011.mkv
Output from ffmpeg:
FFmpeg version git-N-28634-g0bfe349, Copyright (c) 2000-2011 the FFmpeg developers
built on Mar 26 2011 11:06:22 with gcc 4.4.1 [gcc-4_4-branch revision 150839]
configuration: --enable-gpl --enable-nonfree --enable-libmp3lame --enable-libx264 --enable-pthreads --prefix=/usr --enable-postproc --enable-avfilter --enable-libxvid --enable-libschroedinger --enable-shared --enable-libvorbis --enable-libtheora
libavutil 50. 40. 0 / 50. 40. 0
libavcodec 52.114. 1 / 52.114. 1
libavformat 52.103. 0 / 52.103. 0
libavdevice 52. 3. 0 / 52. 3. 0
libavfilter 1. 76. 0 / 1. 76. 0
libswscale 0. 12. 0 / 0. 12. 0
libpostproc 51. 2. 0 / 51. 2. 0
Input #0, mpegts, from 'Summernats 2011.m2t':
Duration: 05:31:35.36, start: 75552.039633, bitrate: 2984 kb/s
Program 1617
Stream #0.0[0x202]: Video: mpeg2video (Main), yuv420p, 1440x1080 [PAR 4:3 DAR 16:9], 90000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0.1[0x2a0](eng): Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s (clean effects)
Stream #0.2[0x241](eng): Subtitle: [6][0][0][0] / 0x0006
Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt'
[buffer @ 0x8074580] w:1440 h:1080 pixfmt:yuv420p
[setdar @ 0x80aa230] a:16/9
[setdar @ 0x80aa230] w:1440 h:1080 -> dar:16/9 par:4/3
[libx264 @ 0x8073f50] using SAR=4/3
[libx264 @ 0x8073f50] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle Cache64
[libx264 @ 0x8073f50] profile Constrained Baseline, level 4.0
[libx264 @ 0x8073f50] 264 - core 114 r1924 08d04a4 - H.264/MPEG-4 AVC codec - Copyleft 2003-2011 - http://www.videolan.org/x264.html - options: cabac=0 ref=5 deblock=1:0:0 analyse=0x1:0x111 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 sliced_threads=0 nr=400 decimate=1 interlaced=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=2pass mbtree=1 bitrate=2048 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 cplxblur=20.0 qblur=0.5 ip_ratio=1.41 aq=1:1.00
Output #0, matroska, to 'Summernats 2011.mkv':
Metadata:
encoder : Lavf52.103.0
Stream #0.0: Video: libx264, yuv420p, 1440x1080 [PAR 4:3 DAR 16:9], q=0-69, pass 2, 2048 kb/s, 1k tbn, 25 tbc
Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, flt, 512 kb/s (clean effects)
Stream mapping:
Press ctrl-c to stop encoding
[ac3 @ 0x80732e0] frame sync error
Error while decoding stream #0.1
Input stream #0.1 frame changed from rate:48000 fmt:s16 ch:6 to rate:48000 fmt:s16 ch:2=0
* glibc detected * ffmpeg: free(): invalid pointer: 0x088b5d60 *
======= Backtrace: =========
/lib/libc.so.6[0xb69725fb]
/lib/libc.so.6[0xb6973ed4]
/lib/libc.so.6(cfree+0x6d)[0xb69770cd]
/usr/lib/libavcodec.so.52(audio_resample+0x34e)[0xb6e1aafe]
ffmpeg[0x804ec45]
ffmpeg[0x805028c]
ffmpeg[0x80546d0]
ffmpeg[0x8054d09]
/lib/libc.so.6(libc_start_main+0xfe)[0xb691bace]
ffmpeg[0x804b971]
======= Memory map: ========
08048000-0805f000 r-xp 00000000 103:f0000 600739 /usr/bin/ffmpeg
0805f000-08060000 r--p 00016000 103:f0000 600739 /usr/bin/ffmpeg
08060000-08061000 rw-p 00017000 103:f0000 600739 /usr/bin/ffmpeg
08061000-08f19000 rw-p 00000000 00:00 0 [heap]
ac200000-ac221000 rw-p 00000000 00:00 0
ac221000-ac300000 ---p 00000000 00:00 0
ac39a000-b0128000 rw-p 00000000 00:00 0
b0235000-b0823000 rw-p 00000000 00:00 0
b08ca000-b3792000 rw-p 00000000 00:00 0
b3792000-b3793000 ---p 00000000 00:00 0
b3793000-b3f93000 rw-p 00000000 00:00 0
b3f93000-b3f94000 ---p 00000000 00:00 0
b3f94000-b4794000 rw-p 00000000 00:00 0
b4794000-b4795000 ---p 00000000 00:00 0
b4795000-b6166000 rw-p 00000000 00:00 0
b6166000-b6184000 r-xp 00000000 103:b0000 514541 /lib/libgcc_s.so.1
b6184000-b6185000 r--p 0001d000 103:b0000 514541 /lib/libgcc_s.so.1
b6185000-b6186000 rw-p 0001e000 103:b0000 514541 /lib/libgcc_s.so.1
b6186000-b626d000 r-xp 00000000 103:f0000 553501 /usr/lib/libstdc++.so.6.0.12
b626d000-b626e000 ---p 000e7000 103:f0000 553501 /usr/lib/libstdc++.so.6.0.12
b626e000-b6272000 r--p 000e7000 103:f0000 553501 /usr/lib/libstdc++.so.6.0.12
b6272000-b6273000 rw-p 000eb000 103:f0000 553501 /usr/lib/libstdc++.so.6.0.12
b6273000-b627a000 rw-p 00000000 00:00 0
b627a000-b62ff000 r-xp 00000000 103:f0000 552729 /usr/lib/liborc-0.4.so.0.11.0
b62ff000-b6300000 r--p 00085000 103:f0000 552729 /usr/lib/liborc-0.4.so.0.11.0
b6300000-b6304000 rw-p 00086000 103:f0000 552729 /usr/lib/liborc-0.4.so.0.11.0
b6304000-b6305000 rw-p 00000000 00:00 0
b6305000-b630a000 r-xp 00000000 103:f0000 238296 /usr/lib/libogg.so.0.6.0
b630a000-b630b000 r--p 00004000 103:f0000 238296 /usr/lib/libogg.so.0.6.0
b630b000-b630c000 rw-p 00005000 103:f0000 238296 /usr/lib/libogg.so.0.6.0
b630c000-b630f000 r-xp 00000000 103:b0000 516013 /lib/libdl-2.10.1.so
b630f000-b6310000 r--p 00002000 103:b0000 516013 /lib/libdl-2.10.1.so
b6310000-b6311000 rw-p 00003000 103:b0000 516013 /lib/libdl-2.10.1.so
b6311000-b6319000 r-xp 00000000 103:b0000 516025 /lib/librt-2.10.1.so
b6319000-b631a000 r--p 00007000 103:b0000 516025 /lib/librt-2.10.1.so
b631a000-b631b000 rw-p 00008000 103:b0000 516025 /lib/librt-2.10.1.so
b631b000-b635f000 r-xp 00000000 103:f0000 551886 /usr/lib/libmp3lame.so.0.0.0
b635f000-b6360000 r--p 00044000 103:f0000 551886 /usr/lib/libmp3lame.so.0.0.0
b6360000-b6362000 rw-p 00045000 103:f0000 551886 /usr/lib/libmp3lame.so.0.0.0
b6362000-b6395000 rw-p 00000000 00:00 0
b6395000-b6451000 r-xp 00000000 103:f0000 555385 /usr/lib/libschroedinger-1.0.so.0.3.0
b6451000-b6452000 r--p 000bc000 103:f0000 555385 /usr/lib/libschroedinger-1.0.so.0.3.0
b6452000-b6454000 rw-p 000bd000 103:f0000 555385 /usr/lib/libschroedinger-1.0.so.0.3.0
b6454000-b6455000 rw-p 00000000 00:00 0
b6455000-b646e000 r-xp 00000000 103:f0000 553019 /usr/lib/libtheoradec.so.1.1.3
b646e000-b646f000 r--p 00018000 103:f0000 553019 /usr/lib/libtheoradec.so.1.1.3
b646f000-b6470000 rw-p 00019000 103:f0000 553019 /usr/lib/libtheoradec.so.1.1.3
b6470000-b64b3000 r-xp 00000000 103:f0000 553085 /usr/lib/libtheoraenc.so.1.1.2
b64b3000-b64b4000 r--p 00043000 103:f0000 553085 /usr/lib/libtheoraenc.so.1.1.2
b64b4000-b64b5000 rw-p 00044000 103:f0000 553085 /usr/lib/libtheoraenc.so.1.1.2
b64b5000-b64e7000 r-xp 00000000 103:f0000 552404 /usr/lib/libvorbis.so.0.4.0
b64e7000-b64e8000 r--p 00031000 103:f0000 552404 /usr/lib/libvorbis.so.0.4.0
b64e8000-b64e9000 rw-p 00032000 103:f0000 552404 /usr/lib/libvorbis.so.0.4.0
b64e9000-b65d8000 r-xp 00000000 103:f0000 553190 /usr/lib/libvorbisenc.so.2.0.3
b65d8000-b65e6000 r--p 000ef000 103:f0000 553190 /usr/lib/libvorbisenc.so.2.0.3
b65e6000-b65e7000 rw-p 000fd000 103:f0000 553190 /usr/lib/libvorbisenc.so.2.0.3
b65e7000-b66d0000 r-xp 00000000 103:f0000 252433 /usr/lib/libx264.so.114
b66d0000-b66d1000 r--p 000e8000 103:f0000 252433 /usr/lib/libx264.so.114
b66d1000-b66d2000 rw-p 000e9000 103:f0000 252433 /usr/lib/libx264.so.114
b66d2000-b66d9000 rw-p 00000000 00:00 0
b66d9000-b677b000 r-xp 00000000 103:f0000 553297 /usr/lib/libxvidcore.so.4.2
b677b000-b677c000 r--p 000a2000 103:f0000 553297 /usr/lib/libxvidcore.so.4.2
b677c000-b6786000 rw-p 000a3000 103:f0000 553297 /usr/lib/libxvidcore.so.4.2
b6786000-b67f0000 rw-p 00000000 00:00 0
b67f0000-b6802000 r-xp 00000000 103:b0000 514486 /lib/libz.so.1.2.3
b6802000-b6803000 r--p 00011000 103:b0000 514486 /lib/libz.so.1.2.3
b6803000-b6804000 rw-p 00012000 103:b0000 514486 /lib/libz.so.1.2.3
b6804000-b6811000 r-xp 00000000 103:b0000 516279 /lib/libbz2.so.1.0.5
b6811000-b6812000 r--p 0000d000 103:b0000 516279 /lib/libbz2.so.1.0.5
b6812000-b6813000 rw-p 0000e000 103:b0000 516279 /lib/libbz2.so.1.0.5
b6813000-b68e4000 r-xp 00000000 103:f0000 556756 /usr/lib/libasound.so.2.0.0
b68e4000-b68e7000 r--p 000d0000 103:f0000 556756 /usr/lib/libasound.so.2.0.0
b68e7000-b68e8000 rw-p 000d3000 103:f0000 556756 /usr/lib/libasound.so.2.0.0
b68e8000-b68f9000 r-xp 00000000 103:f0000 553051 /usr/lib/libjack.so.0.0.28
b68f9000-b68fa000 r--p 00010000 103:f0000 553051 /usr/lib/libjack.so.0.0.28
b68fa000-b68fc000 rw-p 00011000 103:f0000 553051 /usr/lib/libjack.so.0.0.28
b68fc000-b6905000 rw-p 00000000 00:00 0
b6905000-b6a5e000 r-xp 00000000 103:b0000 514114 /lib/libc-2.10.1.so
b6a5e000-b6a5f000 ---p 00159000 103:b0000 514114 /lib/libc-2.10.1.so
b6a5f000-b6a61000 r--p 00159000 103:b0000 514114 /lib/libc-2.10.1.so
b6a61000-b6a62000 rw-p 0015b000 103:b0000 514114 /lib/libc-2.10.1.so
b6a62000-b6a65000 rw-p 00000000 00:00 0
b6a65000-b6a8c000 r-xp 00000000 103:b0000 516015 /lib/libm-2.10.1.so
b6a8c000-b6a8d000 r--p 00027000 103:b0000 516015 /lib/libm-2.10.1.so
b6a8d000-b6a8e000 rw-p 00028000 103:b0000 516015 /lib/libm-2.10.1.so
b6a8e000-b6aa4000 r-xp 00000000 103:b0000 514458 /lib/libpthread-2.10.1.so
b6aa4000-b6aa5000 r--p 00015000 103:b0000 514458 /lib/libpthread-2.10.1.so
b6aa5000-b6aa6000 rw-p 00016000 103:b0000 514458 /lib/libpthread-2.10.1.so
b6aa6000-b6aa8000 rw-p 00000000 00:00 0
b6aa8000-b6ac4000 r-xp 00000000 103:f0000 552805 /usr/lib/libavutil.so.50.40.0
b6ac4000-b6ac5000 r--p 0001b000 103:f0000 552805 /usr/lib/libavutil.so.50.40.0
b6ac5000-b6ac6000 rw-p 0001c000 103:f0000 552805 /usr/lib/libavutil.so.50.40.0
b6ac6000-b6ac9000 rw-p 00000000 00:00 0
b6ac9000-b6b06000 r-xp 00000000 103:f0000 552751 /usr/lib/libswscale.so.0.12.0
b6b06000-b6b07000 r--p 0003c000 103:f0000 552751 /usr/lib/libswscale.so.0.12.0
b6b07000-b6b08000 rw-p 0003d000 103:f0000 552751 /usr/lib/libswscale.so.0.12.0
b6b08000-b6b14000 r-xp 00000000 103:f0000 552750 /usr/lib/libpostproc.so.51.2.0
b6b14000-b6b15000 r--p 0000b000 103:f0000 552750 /usr/lib/libpostproc.so.51.2.0
b6b15000-b6b16000 rw-p 0000c000 103:f0000 552750 /usr/lib/libpostproc.so.51.2.0
b6b16000-b6b17000 rw-p 00000000 00:00 0
b6b17000-b70f6000 r-xp 00000000 103:f0000 552360 /usr/lib/libavcodec.so.52.114.1
b70f6000-b70f7000 r--p 005de000 103:f0000 552360 /usr/lib/libavcodec.so.52.114.1
b70f7000-b7103000 rw-p 005df000 103:f0000 552360 /usr/lib/libavcodec.so.52.114.1
b7103000-b7635000 rw-p 00000000 00:00 0
b7635000-b7731000 r-xp 00000000 103:f0000 552330 /usr/lib/libavformat.so.52.103.0
b7731000-b7732000 r--p 000fb000 103:f0000 552330 /usr/lib/libavformat.so.52.103.0
b7732000-b7739000 rw-p 000fc000 103:f0000 552330 /usr/lib/libavformat.so.52.103.0
b7739000-b779e000 r-xp 00000000 103:f0000 552175 /usr/lib/libavfilter.so.1.76.0
b779e000-b779f000 r--p 00064000 103:f0000 552175 /usr/lib/libavfilter.so.1.76.0
b779f000-b77a2000 rw-p 00065000 103:f0000 552175 /usr/lib/libavfilter.so.1.76.0
b77a2000-b77a7000 rw-p 00000000 00:00 0
b77a7000-b77b2000 r-xp 00000000 103:f0000 552024 /usr/lib/libavdevice.so.52.3.0
b77b2000-b77b3000 r--p 0000a000 103:f0000 552024 /usr/lib/libavdevice.so.52.3.0
b77b3000-b77b4000 rw-p 0000b000 103:f0000 552024 /usr/lib/libavdevice.so.52.3.0
b780b000-b780c000 rw-p 00000000 00:00 0
b780c000-b782a000 r-xp 00000000 103:b0000 516282 /lib/ld-2.10.1.so
b782a000-b782b000 r--p 0001d000 103:b0000 516282 /lib/ld-2.10.1.so
b782b000-b782c000 rw-p 0001e000 103:b0000 516282 /lib/ld-2.10.1.so
bfcf2000-bfd13000 rw-p 00000000 00:00 0 [stack]
ffffe000-fffff000 r-xp 00000000 00:00 0 [vdso]
Aborted
I would upload a sample but the original file is 6.9GB and I'm not sure how far into the file the switch occurs (the status line is overwritten by the segfault data as shown above).
Change History (2)
comment:1 by , 14 years ago
Priority: | important → critical |
---|---|
Reproduced by developer: | set |
Status: | new → open |
Looks critical to me, work-around is to use -acodec ac3_fixed.
Reproducible with
This is a regression because the following works as expected:
I don't get a backtrace with above sample, but with the following: