GNOME Bugzilla – Bug 626125
[alsa] Conditional jump or move depends on uninitialised value(s)
Last modified: 2010-08-12 12:45:18 UTC
This is from older version, but the same uninitialized variable is still in use, namely the 'dir' argument to snd_pcm_hw_params_set_buffer_time_near and snd_pcm_hw_params_set_period_time_near is supposed to be initialized with -1, 0, or 1 before calling as far as I can tell. ==25185== Conditional jump or move depends on uninitialised value(s) ==25185== at 0x7DCEAB3: snd1_pcm_hw_param_set_near (pcm_params.c:829) ==25185== by 0x7DC5D49: snd_pcm_hw_params_set_buffer_time_near@@ALSA_0.9.0rc4 (pcm.c:4978) ==25185== by 0x7D7423F: gst_alsasrc_prepare (gstalsasrc.c:364) ==25185== by 0x7929BF3: gst_audioringbuffer_acquire (gstaudiosrc.c:374) ==25185== by 0x7918267: gst_ring_buffer_acquire (gstringbuffer.c:809) ==25185== by 0x79264B7: gst_base_audio_src_setcaps (gstbaseaudiosrc.c:573) ==25185== by 0x40C68B7: gst_base_src_setcaps (gstbasesrc.c:788) ==25185== by 0x4136313: gst_pad_set_caps (gstpad.c:2606) ==25185== by 0x40C3009: gst_base_src_default_negotiate (gstbasesrc.c:2584) ==25185== by 0x40C0FC4: gst_base_src_start (gstbasesrc.c:2620) ==25185== by 0x40C6F26: gst_base_src_activate_push (gstbasesrc.c:2874) ==25185== by 0x413C00E: gst_pad_activate_push (gstpad.c:923) ==25185== by 0x413C9F4: gst_pad_activate_default (gstpad.c:590) ==25185== by 0x413CAFB: gst_pad_set_active (gstpad.c:679) ==25185== by 0x411B15A: activate_pads (gstelement.c:2632) ==25185== by 0x412D9F6: gst_iterator_fold (gstiterator.c:545) ==25185== by 0x411B08E: iterator_activate_fold_with_resync (gstelement.c:2664) ==25185== by 0x411D69A: gst_element_pads_activate (gstelement.c:2701) ==25185== by 0x411FBFA: gst_element_change_state_func (gstelement.c:2778) ==25185== by 0x40C81DB: gst_base_src_change_state (gstbasesrc.c:3017) ==25185== by 0x7926AE9: gst_base_audio_src_change_state (gstbaseaudiosrc.c:1096) ==25185== by 0x411C434: gst_element_change_state (gstelement.c:2548) ==25185== by 0x411F927: gst_element_set_state_func (gstelement.c:2504) ==25185== by 0x411B7EF: gst_element_set_state (gstelement.c:2405) ==25185== by 0x410B826: gst_bin_change_state_func (gstbin.c:2118) ==25185== by 0x413FF7D: gst_pipeline_change_state (gstpipeline.c:477) ==25185== by 0x411C434: gst_element_change_state (gstelement.c:2548) ==25185== by 0x411C22D: gst_element_continue_state (gstelement.c:2222) ==25185== by 0x411C4BE: gst_element_change_state (gstelement.c:2585) ==25185== by 0x411F927: gst_element_set_state_func (gstelement.c:2504) ==25185== Uninitialised value was created by a stack allocation ==25185== at 0x7D74071: gst_alsasrc_prepare (gstalsasrc.c:639)
Alsa docs are not clear about that http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m___h_w___params.html#g36d74f2e444df32c44f939b89f6dd7ee http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m___h_w___params.html#gf5e53bcb748185a4da3b8538720a5792 but other apps do that, so lets do that as well http://www.google.com/codesearch/p?hl=de#GRf0p-ROlw0/trunk/pd/src/s_audio_alsamm.c&q=snd_pcm_hw_params_set_buffer_time_near&l=479 http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2006-July/044147.html
commit 0fee4ed3d0c264dc4c0cb215d7b88320006ce2fb Author: Stefan Kost <ensonic@users.sf.net> Date: Thu Aug 12 15:26:08 2010 +0300 alsa: remove 'dir' out variable Alsa seems to expect that we initialize it. Remove the variable and pass NULL as we actually don't use it. In alsasink also #ifdef one section that is grabing diagnostics to be disabled, when logging is disabled (the code was using the out parameter as well). Fixes #626125