ref: 1fbfe47ea1e89bf12b69fee4697811471a48e583
parent: 3efafed515a2aa862e36d62e99b7d81e9a34b1d1
author: robs <robs>
date: Sun Jun 14 09:25:30 EDT 2009
fix crash with 0 channels
--- a/src/remix.c
+++ b/src/remix.c
@@ -117,6 +117,10 @@
if (argc && !strcmp(*argv, "-m")) p->mode = manual , ++argv, --argc;
if (argc && !strcmp(*argv, "-a")) p->mode = automatic, ++argv, --argc;
if (argc && !strcmp(*argv, "-p")) p->mix_power = sox_true, ++argv, --argc;
+ if (!argc) {
+ lsx_fail("must specify at least one output channel");
+ return SOX_EOF;
+ }
p->out_specs = lsx_calloc(p->num_out_channels = argc, sizeof(*p->out_specs));
return parse(effp, argv, 1); /* No channels yet; parse with dummy */
}