From b4fde8bcb6d87651ce3fa9ea96b0f7f7f991bc80 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 7 Mar 2025 14:53:49 +0100 Subject: [PATCH] port FIX_956_DECODER_COMMAND_LINE_FIX --- apps/decoder.c | 20 ++++++++++++++++++++ lib_com/options.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/apps/decoder.c b/apps/decoder.c index 2bff1fab6..5d126a27e 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1289,7 +1289,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 8eb059537..8d9315c1e 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -182,6 +182,8 @@ #define ISAR_BITSTREAM_UPDATE_LC3PLUS /* FhG: Multiple improvements to the ISAR bitstream when LC3plus is used. See MR 1456 for details. */ #endif +#define FIX_956_DECODER_COMMAND_LINE_FIX /* VA: Output correct error message when the decoder command-line has too many mandatory arguments. */ + /* #################### End BASOP porting switches ############################ */ #endif -- GitLab