diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index 1bf42acf..fb24480b 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -569,7 +569,14 @@ V4L2SubdeviceFormat CameraSensor::getFormat(const std::vector<unsigned int> &mbu
 			unsigned int area = sz.width * sz.height;
 			unsigned int areaDiff = area - desiredArea;
 
-			if (ratioDiff > bestRatio)
+			/*
+			 * Check if we have a better aspect ratio match than
+			 * whatever we have seen before. ~1% change is acceptable
+			 * if it leads to a selection of lower resolution below.
+			 */
+			if (bestRatio == FLT_MAX)
+				bestRatio = ratioDiff;
+			else if (fabsf(ratioDiff - bestRatio) > 0.01)
 				continue;
 
 			if (areaDiff < bestArea) {
