diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index a2f893ed78edd4d5055503e9eb720de1a8d323f4..c6d18125e296bfbb0310733888cb81a336bc98d5 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -134,6 +134,9 @@ typedef enum IVAS_ERR_BITSTREAM_READER_INVALID_FORMAT, IVAS_ERR_NO_FILE_OPEN, IVAS_ERR_SAMPLING_RATE_UNKNOWN, +#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK + IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT, +#endif /*----------------------------------------* * renderer (lib_rend only) * @@ -271,6 +274,10 @@ static inline const char *ivas_error_to_string( ivas_error error_code ) return "Invalid input format"; case IVAS_ERR_INVALID_INDEX: return "Invalid index"; +#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK + case IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT: + return "Euler angles were detected in the input but only Quaternions are supported"; +#endif default: break; } diff --git a/lib_com/options.h b/lib_com/options.h index f2d58b90061044e84f65334570bb2d1a3839d7fb..45ca705378ba7ac1916c7255687aad51aa0a5a6c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -167,6 +167,7 @@ #define FIX_1369_HQ_LR_OVERFLOW /* FhG: fix BASOP overflow in hq_lr_enc(), brings floating-point code inline with FX */ #define FIX_1376_MISSING_ISM_METADATA /* FhG: IVAS_rend: throw error if there exists an ISM input without a corresponding metadata file path */ #define FIX_1330_JBM_MEMORY /* VA: issue 1330: memory savings in the JBM decoder */ +#define FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Nokia: add sanity check for Euler angles for external orientations */ /* #################### End BE switches ################################## */ diff --git a/lib_util/rotation_file_reader.c b/lib_util/rotation_file_reader.c index 024b0837374c9ccbefd5519817ba00dd7e4981ba..6c62290b002e4c9a6aeb9d268c10a6aeb369b0fb 100644 --- a/lib_util/rotation_file_reader.c +++ b/lib_util/rotation_file_reader.c @@ -174,6 +174,14 @@ ivas_error ExternalOrientationFileReading( } ( externalOrientationReader->frameCounter )++; +#ifdef FIX_1370_EXTERNAL_ORIENTATION_CHECK + + /* Only Quaternion orientations are supported, raise an error if Euler angles are detected in the input */ + if ( w == -3.0f ) + { + return IVAS_ERR_EXTERNAL_ORIENTATION_INVALID_FORMAT; + } +#endif pQuaternion->w = w; pQuaternion->x = x;