Wrong padding size calculated (copy-paste error)
diff --git a/common/rfb/PixelFormat.cxx b/common/rfb/PixelFormat.cxx
index 9ec6b46..76051dc 100644
--- a/common/rfb/PixelFormat.cxx
+++ b/common/rfb/PixelFormat.cxx
@@ -260,7 +260,7 @@
     }
   } else {
     // Generic code
-    int dstPad = (stride - w) * 4;
+    int dstPad = (stride - w) * bpp/8;
     while (h--) {
       int w_ = w;
       while (w_--) {