Fix sanitizer in audioflinger Threads.cpp.
In RecordThread::start(), an unsigned integer is negated before being
set to mFramesToDrop (which is ssize_t). This causes a runtime error on
integer sanitized builds.
runtime error: negation of 1323000 cannot be represented in type
'unsigned int'
This makes the conversion to ssize_t explicitly occur before the
negation.
Bug: 30969751
Test: Compiles.
Change-Id: I9cf2e31728ff715c9755f257c1abf10fa5efbf82
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index b2a1e18..af4c7cb 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -6874,7 +6874,7 @@
recordTrack->clearSyncStartEvent();
} else {
// do not wait for the event for more than AudioSystem::kSyncRecordStartTimeOutMs
- recordTrack->mFramesToDrop = -
+ recordTrack->mFramesToDrop = -(ssize_t)
((AudioSystem::kSyncRecordStartTimeOutMs * recordTrack->mSampleRate) / 1000);
}
}