Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
Vorbis
Vorbis
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Xiph.Org
  • VorbisVorbis
  • Issues
  • #1818

Closed
Open
Opened Jul 22, 2011 by Mathieu Geli@mathieu.geli

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

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: xiph/vorbis#1818