fix: update image flipping to create a writable copy

This commit is contained in:
2026-07-06 22:40:56 +08:00
parent 2073af147b
commit 148a39b591
+3 -1
View File
@@ -170,7 +170,9 @@ class AScreenCap(Connection):
# ValueError: cannot reshape array of size 0 into shape (720,1280,4)
raise ImageTruncated(str(e))
cv2.flip(image, 0, dst=image)
# flip without `dst=image`
# np.frombuffer creates a read-only memory view, we need to create a writable copy here
image = cv2.flip(image, 0)
if image is None:
raise ImageTruncated('Empty image after cv2.flip')