diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 78b0246e40f0..9f3f3315aed4 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1036,12 +1036,13 @@ FrameBuffer *CameraDevice::createFrameBuffer(const buffer_handle_t camera3buffer
 			break;
 		}
 
-		/*
-		 * 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) {
+			LOG(HAL, Error) << "Failed to query plane length";
+			break;
+		}
+
+		plane.length = length;
 		planes.push_back(std::move(plane));
 	}
 
