diff --git a/lib_com/ivas_error.h b/lib_com/ivas_error.h index 58c356adef991ebc1f76b23b1e17fb6a2d22038b..0f47de161222eb175979a26522f6d1711dfa3242 100644 --- a/lib_com/ivas_error.h +++ b/lib_com/ivas_error.h @@ -136,6 +136,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) * @@ -275,6 +278,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 3f26635f13947d1e6198991785fab4d685110ecd..e422a9e12ff5f48b17d1b6fe026f03ca4459c082 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -192,6 +192,7 @@ #define UNIFIED_DECODING_PATHS_LEFTOVERS /* VA: issue 880: remove leftovers after NONBE_UNIFIED_DECODING_PATHS */ #define FIX_NCHAN_BUFFERS /* VA: issue 1322: Correct the number of float buffers (channels) at the decoder */ #define FIX_RENDERER_STACK /* VA: issue 1322: reduction of renderers' buffers size */ +#define FIX_1370_EXTERNAL_ORIENTATION_CHECK /* Nokia: add sanity check for Euler angles for external orientations */ // object-editing feature porting #define FIX_HRTF_LOAD_API // solves API conflicts between HRTF and object-editing features diff --git a/lib_util/rotation_file_reader.c b/lib_util/rotation_file_reader.c index f659fbb9fa558c8312f2b8c1c3b909f73b980474..ad16530561b52089603b8a7d538988d387a9476f 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;