diff --git a/SOURCES/tigervnc-fix-typo-in-mirror-monitor-detection.patch b/SOURCES/tigervnc-fix-typo-in-mirror-monitor-detection.patch
new file mode 100644
index 0000000..9076432
--- /dev/null
+++ b/SOURCES/tigervnc-fix-typo-in-mirror-monitor-detection.patch
@@ -0,0 +1,34 @@
+From 2daf4126882f82b6e392dfbae87205dbdc559c3d Mon Sep 17 00:00:00 2001
+From: Pierre Ossman <ossman@cendio.se>
+Date: Thu, 23 Dec 2021 15:58:00 +0100
+Subject: [PATCH] Fix typo in mirror monitor detection
+
+Bug introduced in fb561eb but still somehow passed manual testing.
+Resulted in some stray reads off the end of the stack, which were
+hopefully harmless.
+---
+ vncviewer/MonitorIndicesParameter.cxx | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/vncviewer/MonitorIndicesParameter.cxx b/vncviewer/MonitorIndicesParameter.cxx
+index 5130831cb..4ac74dd1a 100644
+--- a/vncviewer/MonitorIndicesParameter.cxx
++++ b/vncviewer/MonitorIndicesParameter.cxx
+@@ -211,13 +211,13 @@ std::vector<MonitorIndicesParameter::Monitor> MonitorIndicesParameter::fetchMoni
+         // Only keep a single entry for mirrored screens
+         match = false;
+         for (int j = 0; j < ((int) monitors.size()); j++) {
+-            if (monitors[i].x != monitor.x)
++            if (monitors[j].x != monitor.x)
+                 continue;
+-            if (monitors[i].y != monitor.y)
++            if (monitors[j].y != monitor.y)
+                 continue;
+-            if (monitors[i].w != monitor.w)
++            if (monitors[j].w != monitor.w)
+                 continue;
+-            if (monitors[i].h != monitor.h)
++            if (monitors[j].h != monitor.h)
+                 continue;
+
+             match = true;
diff --git a/SPECS/tigervnc.spec b/SPECS/tigervnc.spec
index 7ca14b4..dc461a2 100644
--- a/SPECS/tigervnc.spec
+++ b/SPECS/tigervnc.spec
@@ -5,7 +5,7 @@
 
 Name:           tigervnc
 Version:        1.12.0
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        A TigerVNC remote display system
 
 %global _hardened_build 1
@@ -25,7 +25,7 @@ Patch1:         tigervnc-use-gnome-as-default-session.patch
 
 # Upstream patches
 Patch50:        tigervnc-selinux-restore-context-in-case-of-different-policies.patch
-
+Patch51:        tigervnc-fix-typo-in-mirror-monitor-detection.patch
 
 # This is tigervnc-%%{version}/unix/xserver116.patch rebased on the latest xorg
 Patch100:       tigervnc-xserver120.patch
@@ -154,6 +154,7 @@ popd
 
 # Upstream patches
 %patch50 -p1 -b .selinux-restore-context-in-case-of-different-policies
+%patch51 -p1 -b .fix-typo-in-mirror-monitor-detection
 
 
 %build
@@ -308,6 +309,10 @@ fi
 %ghost %verify(not md5 size mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{modulename}
 
 %changelog
+* Fri Jan 21 2022 Jan Grulich <jgrulich@redhat.com> - 1.12.0-3
+- Fix crash in vncviewer
+  Resolves: bz#2021892
+
 * Fri Jan 14 2022 Jan Grulich <jgrulich@redhat.com> - 1.12.0-2
 - Remove unavailable option from vncserver script
   Resolves: bz#2021892