diff --git a/com.unity.render-pipelines.core/Runtime/Camera/CameraSwitcher.cs b/com.unity.render-pipelines.core/Runtime/Camera/CameraSwitcher.cs index 91754c7bdaf..8f8772bec44 100644 --- a/com.unity.render-pipelines.core/Runtime/Camera/CameraSwitcher.cs +++ b/com.unity.render-pipelines.core/Runtime/Camera/CameraSwitcher.cs @@ -89,7 +89,7 @@ Camera GetNextCamera() void SetCameraIndex(int index) { - if (index > 0 || index < GetCameraCount()) + if (index > 0 && index < GetCameraCount()) { m_CurrentCameraIndex = index; diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index ae3344ebf39..3d11f0a06ac 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -622,6 +622,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed Wizard check on default volume profile to also check it is not the default one in package. - Fix erroneous central depth sampling in TAA. - Fixed light layers not correctly disabled when the lightlayers is set to Nothing and Lightlayers isn't enabled in HDRP Asset +- Fixed a wrong condition in CameraSwitcher, potentially causing out of bound exceptions. ### Changed - Improve MIP selection for decals on Transparents