diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 538b8ab5da03..6212ccdd61ec 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1045,12 +1045,18 @@ FrameBuffer *CameraDevice::createFrameBuffer(const buffer_handle_t camera3buffer
 			continue;
 		}
 
-		/*
-		 * Setting length to zero here is OK as the length is only used
-		 * to map the memory of the plane. Libcamera do not need to poke
-		 * at the memory content queued by the HAL.
-		 */
-		plane.length = 0;
+		off_t length = lseek(plane.fd.fd(), 0, SEEK_END);
+		if (length == -1) {
+			/*
+			 * A zero length plane is not fatal unless the
+			 * FrameBuffer is used for a software stream, libcamera
+			 * itself will not access the internal frame content.
+			 */
+			LOG(HAL, Error) << "Failed to query plane length";
+			length = 0;
+		}
+
+		plane.length = length;
 		planes.push_back(std::move(plane));
 	}
 
