@@ -200,16 +200,17 @@ struct DecoderConfig {
200200 }},
201201 {" --input" , " -i" , 1 , " Input filename to decode" ,
202202 [this ](const char **args, const ProgramArgs &a) {
203- videoFileName = args[0 ];
204- std::ifstream inputFile (videoFileName, std::ifstream::in);
205- if (!inputFile.is_open ()) {
206- std::cerr << " Error: Cannot open input file \" " << videoFileName << " \" " << std::endl;
203+ if (!vk::IsValidFilePath (args[0 ], true )) {
207204 return false ;
208205 }
206+ videoFileName = args[0 ];
209207 return true ;
210208 }},
211209 {" --output" , " -o" , 1 , " Output filename to dump raw video to" ,
212210 [this ](const char **args, const ProgramArgs &a) {
211+ if (!vk::IsValidFilePath (args[0 ], false )) {
212+ return false ;
213+ }
213214 outputFileName = args[0 ];
214215 return true ;
215216 }},
@@ -310,6 +311,9 @@ struct DecoderConfig {
310311 }},
311312 {" --crcoutfile" , nullptr , 1 , " Output file to store the CRC output into." ,
312313 [this ](const char **args, const ProgramArgs &a) {
314+ if (!vk::IsValidFilePath (args[0 ], false )) {
315+ return false ;
316+ }
313317 crcOutputFileName = args[0 ];
314318 return true ;
315319 }},
0 commit comments