Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2831 closed defect (fixed)

TTA encoder segmentation fault with 24 bits multichannel input

Reported by: jamal Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: tta sigsegv
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

jamrial@GentooVM ~/build $ gdb ffmpeg_g
GNU gdb (Gentoo 7.5.1 p2) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /home/jamrial/build/ffmpeg_g...done.
(gdb) r -i ../24.wav -c:a tta -f null -
Starting program: /home/jamrial/build/ffmpeg_g -i ../24.wav -c:a tta -f null -
warning: Could not load shared library symbols for linux-gate.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
ffmpeg version N-55178-g2b9590e Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug  2 2013 13:02:19 with gcc 4.6.3 (Gentoo 4.6.3 p1.13, pie-0.5.2)
  configuration: --enable-gpl --cpu=i686 --disable-optimizations --enable-debug=gdb
  libavutil      52. 40.100 / 52. 40.100
  libavcodec     55. 19.100 / 55. 19.100
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.100 /  3. 82.100
  libswscale      2.  4.100 /  2.  4.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, wav, from '../24.wav':
  Metadata:
    encoder         : Lavf55.12.102
  Duration: 00:00:15.00, bitrate: 9216 kb/s
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 96000 Hz, quad, s32, 9216 kb/s
[New Thread 0xb7dbab40 (LWP 24508)]
[New Thread 0xb75b9b40 (LWP 24509)]
[New Thread 0xb6db8b40 (LWP 24510)]
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf55.12.102
    Stream #0:0: Audio: tta, 96000 Hz, quad, s32, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s24le -> tta)
Press [q] to stop, [?] for help

Program received signal SIGSEGV, Segmentation fault.
0xb7e32e18 in ?? () from /lib/libc.so.6
(gdb) bt
#0  0xb7e32e18 in ?? () from /lib/libc.so.6
#1  0xb7e33e6f in ?? () from /lib/libc.so.6
#2  0xb7e36985 in malloc () from /lib/libc.so.6
#3  0x0892e916 in av_realloc (ptr=0x0, size=656393) at /home/jamrial/ffmpeg/libavutil/mem.c:164
#4  0x089224d9 in av_buffer_realloc (pbuf=0xbffff1f4, size=656393) at /home/jamrial/ffmpeg/libavutil/buffer.c:164
#5  0x0824ae3b in copy_packet_data (pkt=0xbffff1f4, src=0xbfffeed8, dup=1) at /home/jamrial/ffmpeg/libavcodec/avpacket.c:194
#6  0x0824b19c in av_dup_packet (pkt=0xbffff1f4) at /home/jamrial/ffmpeg/libavcodec/avpacket.c:243
#7  0x086343c1 in avcodec_encode_audio2 (avctx=0x9200b00, avpkt=0xbffff1f4, frame=0x9204cc0, got_packet_ptr=0xbffff1f0) at /home/jamrial/ffmpeg/libavcodec/utils.c:1607
#8  0x0805969f in do_audio_out (s=0x9200420, ost=0x9200ee0, frame=0x9204cc0) at /home/jamrial/ffmpeg/ffmpeg.c:693
#9  0x0805b0a1 in reap_filters () at /home/jamrial/ffmpeg/ffmpeg.c:1100
#10 0x0806400b in transcode_step () at /home/jamrial/ffmpeg/ffmpeg.c:3168
#11 0x080640c6 in transcode () at /home/jamrial/ffmpeg/ffmpeg.c:3211
#12 0x080645d0 in main (argc=8, argv=0xbffff544) at /home/jamrial/ffmpeg/ffmpeg.c:3389
(gdb)

This seems to be only with 24 bits multichannel input. 16 bits is fine, and if i use "-ac 2" to make the 24 bits 4.0 input stereo it doesn't crash.

Change History (2)

comment:1 by Elon Musk, 11 years ago

Resolution: fixed
Status: newclosed

comment:2 by Carl Eugen Hoyos, 11 years ago

Was a specific sample needed?

$ ffmpeg -f s24le -ar 96k -ac 4 -i /dev/zero -t 15 -acodec pcm_s24le 24.wav
$ ffmpeg -i 24.wav -acodec tta -f null -
ffmpeg version N-55178-g2b9590e Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug  2 2013 20:15:32 with gcc 4.7 (SUSE Linux)
  configuration: --cc='gcc -m32' --enable-gpl --cpu=i686 --disable-optimizations --enable-debug=gdb
  libavutil      52. 40.100 / 52. 40.100
  libavcodec     55. 19.100 / 55. 19.100
  libavformat    55. 12.102 / 55. 12.102
  libavdevice    55.  3.100 / 55.  3.100
  libavfilter     3. 82.100 /  3. 82.100
  libswscale      2.  4.100 /  2.  4.100
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Input #0, wav, from '24.wav':
  Metadata:
    encoder         : Lavf55.12.102
  Duration: 00:00:15.01, bitrate: 9216 kb/s
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 96000 Hz, 4.0, s32, 9216 kb/s
Output #0, null, to 'pipe:':
  Metadata:
    encoder         : Lavf55.12.102
    Stream #0:0: Audio: tta, 96000 Hz, 4.0, s32, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s24le -> tta)
Press [q] to stop, [?] for help
size=N/A time=00:00:15.67 bitrate=N/A
video:0kB audio:707kB subtitle:0 global headers:0kB muxing overhead -100.003038%

valgrind shows no problems either here.

Note: See TracTickets for help on using tickets.