diff --git a/src/plugins/imageformats/dds/qddshandler.cpp b/src/plugins/imageformats/dds/qddshandler.cpp
index 2fb6162f316d6b322df64b906850c6d460238d86..6ec28044ad8d2f88a7e8b696bcca3d0fc8258ade 100644
--- a/src/plugins/imageformats/dds/qddshandler.cpp
+++ b/src/plugins/imageformats/dds/qddshandler.cpp
@@ -323,7 +323,7 @@ static Format getFormat(const DDSHeader &dds)
             if ((format.flags & info.flags) == info.flags &&
                  format.rgbBitCount == info.bitCount &&
                  format.rBitMask == info.rBitMask &&
-                 format.bBitMask == info.bBitMask &&
+                 format.gBitMask == info.gBitMask &&
                  format.bBitMask == info.bBitMask &&
                  format.aBitMask == info.aBitMask) {
                 return info.format;