Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--time-limit=2600 times out immediately on Windows #5355

Closed
rom1v opened this issue Oct 8, 2024 · 1 comment
Closed

--time-limit=2600 times out immediately on Windows #5355

rom1v opened this issue Oct 8, 2024 · 1 comment

Comments

@rom1v
Copy link
Collaborator

rom1v commented Oct 8, 2024

Please read the prerequisites to run scrcpy.

Also read the FAQ and check if your issue already exists.

Environment

  • OS: Windows
  • Scrcpy version: 2.7
  • Installation method: Windows release
  • Device model: any
  • Android version: any

Describe the bug

Reported on reddit:

I'm trying to use --time-limit and set it to 2600 seconds but it immediately closes.

rom1v added a commit that referenced this issue Oct 8, 2024
With the old macros definitions, the type of the result depended on the
type of `sec`.

In particular, if sec is a 32-bit type, sec * 1000000 was likely to
overflow (even if the result was assigned to a sc_tick by the caller of
the macro).

This was the case on Windows, where the long type is a 32-bit signed
integer: the --time-limit argument, expressed in seconds, was first
parsed to a long value, then multiplied by 1000000 by the
SC_TICK_FROM_SEC() macro, causing an overflow when the value was greater
than 2147 (2^31 / 1000000).

Fixes #5355 <#5355>
@rom1v
Copy link
Collaborator Author

rom1v commented Oct 8, 2024

Fixed by afbaf59

@rom1v rom1v closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant