diff --git a/app/node/output/viewer/viewer.h b/app/node/output/viewer/viewer.h index 8780c17b5..820c9b934 100644 --- a/app/node/output/viewer/viewer.h +++ b/app/node/output/viewer/viewer.h @@ -72,12 +72,24 @@ public: VideoParams GetVideoParams(int index = 0) const { - return GetStandardValue(kVideoParamsInput, index).value(); + // This check isn't strictly necessary (GetStandardValue will return a null VideoParams anyway), + // but it does suppress a warning message that we don't need + if (index < InputArraySize(kVideoParamsInput)) { + return GetStandardValue(kVideoParamsInput, index).value(); + } else { + return VideoParams(); + } } AudioParams GetAudioParams(int index = 0) const { - return GetStandardValue(kAudioParamsInput, index).value(); + // This check isn't strictly necessary (GetStandardValue will return a null VideoParams anyway), + // but it does suppress a warning message that we don't need + if (index < InputArraySize(kAudioParamsInput)) { + return GetStandardValue(kAudioParamsInput, index).value(); + } else { + return AudioParams(); + } } void SetVideoParams(const VideoParams &video, int index = 0)