Resolve "Sanitizer issue when accessing headRotData in IVAS rend"
- Related issues: #1383
- Requested reviewers:
Reason why this change is needed
Memory sanitizer error is raised in combine_external_and_head_orientations_rend()
when accessing hHeadTrackData
(which is a pointer to hIvasRend->headRotData
) values. This is caused because headRotData
is not a pointer but a structure within hIvasRend
. The check for NULL pointer in line 901 in ivas_rotation.c
is then always passing (even though headRotData
would not have been initialized) and passing the read hHeadTrackData.sr_pose_pred_axis
to the return function raises a sanitizer error.
One way to fix this is to change the NULL check to compare headRotEnabled
value. In this case setting the value for sr_pose_pred_axis
is also moved under this comparison.
Description of the change
This changes the check to use headRotEnabled
which should provide the correct state. Also removes then redundant inner check.
Affected operating points
- Affects only IVAS_rend and fixes a somewhat widely happening use-of-uninitialized value sanitizer error there. Should be BE.
Related to #1383