libvorbisenc NULL dereference
Hi,
I'm running mpd with vorbis streaming enabled on an ARMv5 device. mpd SEGFAULT upon startup because of libvorbisenc.so.2 as seen by this GDB log :
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x43d9c410 (LWP 25624)]
0x4101bd20 in vorbis_encode_setup_init () from /usr/lib/libvorbisenc.so.2
(gdb) x/16i $pc
=> 0x4101bd20 <vorbis_encode_setup_init+6420>: ldr r4, [r2, #4]
0x4101bd24 <vorbis_encode_setup_init+6424>: cmp r4, #0
0x4101bd28 <vorbis_encode_setup_init+6428>: mvneq r0, #0
0x4101bd2c <vorbis_encode_setup_init+6432>: beq 0x4101bdd4 <vorbis_encode_setup_init+6600>
0x4101bd30 <vorbis_encode_setup_init+6436>: mov r1, r11
0x4101bd34 <vorbis_encode_setup_init+6440>: mov r0, r10
[...]
NULL deref is here in vorbis/lib/vorbisenc.c :
static double setting_to_approx_bitrate(vorbis_info *vi){
[...]
r = setup->rate_mapping; // setup == NULL
[...]
}
setup (that is (&(&vi->codec_setup)->hi)->setup ) is changed to NULL in the following code :
static void vorbis_encode_floor_setup(vorbis_info *vi,int s,
const static_codebook *const *const *const books,
const vorbis_info_floor1 *in,
const int *x){
int i,k,is=s;
vorbis_info_floor1 *f=_ogg_calloc(1,sizeof(*f));
codec_setup_info *ci=vi->codec_setup;
If I swap the last two lines and watch (&ci->hi)->setup before and after the _ogg_calloc call I see that after it is NULL.
Any suggestions to fix that ?
Thanks !
-- Mathieu