Skip to content

Commit a512af5

Browse files
committed
Check the length of the screencap before indexing into it
1 parent 311aa40 commit a512af5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ppadb/command/transport_async/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async def screencap(self):
3434
await conn.send(cmd)
3535
result = await conn.read_all()
3636

37-
if result[5] == 0x0d:
37+
if result and len(result) > 5 and result[5] == 0x0d:
3838
return result.replace(b'\r\n', b'\n')
3939
else:
4040
return result

0 commit comments

Comments
 (0)