shithub: opus-tools

Download patch

ref: 70008dd788e42abad023a5f6739b3a977c34e403
parent: 2fdb85b5752513848ce91eb25fda4a5af473974e
author: Mark Harris <[email protected]>
date: Sat Dec 30 12:45:07 EST 2017

opusenc: Don't save --picture in ENCODER_OPTIONS

Saving --picture leaks local file paths. Also don't save options that
relate only to console output or input file handling like --quiet and
--ignorelength.

--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -418,6 +418,7 @@
       case 0:
         if(strcmp(long_options[option_index].name,"quiet")==0){
           quiet=1;
+          save_cmd=0;
         }else if(strcmp(long_options[option_index].name,"bitrate")==0){
           bitrate=atof(optarg)*1000.;
         }else if(strcmp(long_options[option_index].name,"hard-cbr")==0){
@@ -443,6 +444,7 @@
           exit(0);
         }else if(strcmp(long_options[option_index].name,"ignorelength")==0){
           inopt.ignorelength=1;
+          save_cmd=0;
         }else if(strcmp(long_options[option_index].name,"raw")==0){
           inopt.rawmode=1;
           save_cmd=0;
@@ -595,6 +597,7 @@
           char *description_copy;
           FILE *picture_file;
           int picture_type;
+          save_cmd=0;
           spec = optarg;
           picture_type=3;
           media_type=media_type_end=description=description_end=filename=spec;
@@ -664,9 +667,10 @@
         } else if(strcmp(long_options[option_index].name,"discard-pictures")==0){
           inopt.copy_pictures=0;
         }
-        /*Commands whose arguments would leak file paths or just end up as metadata
-           should have save_cmd=0; to prevent them from being saved in the
-           command-line tag.*/
+        /*Options whose arguments would leak file paths or just end up as
+           metadata, or that relate only to input file handling or console
+           output, should have save_cmd=0; to prevent them from being saved
+           in the ENCODER_OPTIONS tag.*/
         break;
       case 'h':
         usage();