fix crash on wrong long option, rename --ignore-length to --ignorelength
[fdkaac.git] / src / main.c
index 724accbc6e7754d31afc8b0a112a0b891e3e5c00..5221387f7c60e12a6befc667fd934e15f2806dc1 100644 (file)
@@ -108,7 +108,7 @@ PROGNAME " %s\n"
 "                               transport layer\n"
 "\n"
 " -o <filename>                 Output filename\n"
-" --ignore-length               Ignore length of WAV header\n"
+" --ignorelength                Ignore length of WAV header\n"
 "\n"
 "Options for raw (headerless) input:\n"
 " -R, --raw                     Treat input as raw (by default WAV is\n"
@@ -212,7 +212,7 @@ int parse_options(int argc, char **argv, aacenc_param_ex_t *params)
         { "adts-crc-check",   no_argument,       0, 'C' },
         { "header-period",    required_argument, 0, 'P' },
 
-        { "ignore-length",    no_argument,       0, 'I' },
+        { "ignorelength",     no_argument,       0, 'I' },
 
         { "raw",              no_argument,       0, 'R' },
         { "raw-channels",     required_argument, 0, OPT_RAW_CHANNELS       },
@@ -233,6 +233,7 @@ int parse_options(int argc, char **argv, aacenc_param_ex_t *params)
         { "tempo",            required_argument, 0, M4AF_TAG_TEMPO         },
         { "tag",              required_argument, 0, OPT_SHORT_TAG          },
         { "long-tag",         required_argument, 0, OPT_LONG_TAG           },
+        { 0,                  0,                 0, 0                      },
     };
     params->afterburner = 1;
 
@@ -357,6 +358,14 @@ int parse_options(int argc, char **argv, aacenc_param_ex_t *params)
                 }
                 *val++ = '\0';
                 if (ch == OPT_SHORT_TAG) {
+                    /*
+                     * take care of U+00A9(COPYRIGHT SIGN).
+                     * 1) if length of fcc is 3, we prepend '\xa9'.
+                     * 2) U+00A9 becomes "\xc2\xa9" in UTF-8. Therefore
+                     *    we remove first '\xc2'.
+                     */
+                    if (optarg[0] == '\xc2')
+                        ++optarg;
                     if ((klen = strlen(optarg))== 3)
                         fcc = 0xa9;
                     else if (klen != 4) {
@@ -470,7 +479,7 @@ END:
 }
 
 static
-int put_tag_entry(m4af_writer_t *m4af, const aacenc_tag_entry_t *tag)
+void put_tag_entry(m4af_writer_t *m4af, const aacenc_tag_entry_t *tag)
 {
     unsigned m, n = 0;
 
This page took 0.0108549999999999 seconds and 4 git commands to generate.