diff --git a/apps/decoder.c b/apps/decoder.c index 54879bb30eec9ac0cc5465c5fd33df2bd0c2baf7..7c13aa693f58fbc5c129c804c1126879c296858e 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1619,7 +1619,27 @@ static bool parseCmdlIVAS_dec( * Mandatory input arguments *-----------------------------------------------------------------*/ +#ifdef FIX_956_DECODER_COMMAND_LINE_FIX + if ( i < argc - 4 ) + { + for ( i = 1; i < argc; i++ ) + { + if ( argv[i][0] == '-' ) + { + fprintf( stderr, "Error: Wrong order of command-line arguments (optional arguments are first)\n\n" ); + usage_dec(); + return false; + } + } + + fprintf( stderr, "Error: Too many mandatory command-line arguments\n\n" ); + usage_dec(); + return false; + } + else if ( i < argc - 3 ) +#else if ( i < argc - 3 ) +#endif { arg->outputConfig = cmdline2config( argv[i] ); if ( arg->outputConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) diff --git a/lib_com/options.h b/lib_com/options.h index 5dea622479440516338c75ea0151cedcce37152d..743d9db9d2dac38fe848dd2f683e9d8bb2cc77b0 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,6 +157,7 @@ #define FIX_WARNING_RENDER_CONFIG /* Orange: fix warning on windows build */ #define FIX_958_667_DISABLE_INITIAL_PLC_SUPPRESSION /* Ericsson: Fix related to issue 667 in IVAS BASOP. Handling of initial lost frame in IVAS causes non-BE on EVS BASOP 26.444 */ #define FIX_957_REMOVE_PANNING_DEAD_CODE /* VA: Remove obsolete non-diegetic panning related code. */ +#define FIX_956_DECODER_COMMAND_LINE_FIX /* VA: Output correct error message when the decoder command-line has too many mandatory arguments. */ /* #################### End BE switches ################################## */