[pulseaudio-discuss] [PATCHv2 1/5] echo-cancel-test: Fix echo-cancel-test's argument number checking

Stefan Huber s.huber at bct-electronic.com
Tue Dec 18 04:52:30 PST 2012


thank you for your comments! While adapting the patches according to
your suggestions, two bugs came to my attention, which partly interfere
with the original patches. Therefore I added the two fixes (patch 1/5
and 2/5) to this thread.

Best,
Stefan

P.S. This patch series applies against the "next" branch of
git.gitorious.org/~tanuk/pulseaudio/tanuk-clone.git

-- >8 --

Argument argv[5] is accessed when argc>4, which leads to an invalid
access for argc==5. Fix this.

Signed-off-by: Stefan Huber <s.huber at bct-electronic.com>
Acked-by: Peter Meerwald <p.meerwald at bct-electronic.com>
---
 src/modules/echo-cancel/module-echo-cancel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index 26ac30b..f7c7276 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -2108,7 +2108,7 @@ int main(int argc, char* argv[]) {
         goto fail;
 
     if (!u.ec->init(u.core, u.ec, &source_ss, &source_map, &sink_ss, &sink_map, &u.blocksize,
-                     (argc > 4) ? argv[5] : NULL )) {
+                     (argc > 5) ? argv[5] : NULL )) {
         pa_log("Failed to init AEC engine");
         goto fail;
     }
-- 
1.7.9.5



More information about the pulseaudio-discuss mailing list