mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-02 22:29:25 +00:00
Fix integer overflow for audio packet duration
The result is assigned to a long (64-bit signed integer), but the intermediate multiplication was stored in an int (32-bit signed integer). This value is only used as a fallback when no timestamp could be retrieved, that's why it did not cause too much harm so far. Fixes #4536 <https://github.com/Genymobile/scrcpy/issues/4536>
This commit is contained in:
parent
4cd61b5a90
commit
ec41896c85
1 changed files with 1 additions and 1 deletions
|
@ -159,7 +159,7 @@ public final class AudioCapture {
|
||||||
pts = nextPts;
|
pts = nextPts;
|
||||||
}
|
}
|
||||||
|
|
||||||
long durationUs = r * 1000000 / (CHANNELS * BYTES_PER_SAMPLE * SAMPLE_RATE);
|
long durationUs = r * 1000000L / (CHANNELS * BYTES_PER_SAMPLE * SAMPLE_RATE);
|
||||||
nextPts = pts + durationUs;
|
nextPts = pts + durationUs;
|
||||||
|
|
||||||
if (previousPts != 0 && pts < previousPts + ONE_SAMPLE_US) {
|
if (previousPts != 0 && pts < previousPts + ONE_SAMPLE_US) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue