am 99253d00: Merge "AudioRecorder read buffer overflow" into lmp-mr1-dev

automerge: 5ff6057

* commit '5ff6057bd32737c808f978eae6c100ffa24148d1':
  AudioRecorder read buffer overflow
This commit is contained in:
Eric Laurent
2014-11-14 21:41:15 +00:00
committed by android-build-merger

View File

@@ -431,7 +431,7 @@ static jint android_media_AudioRecord_readInShortArray(JNIEnv *env, jobject thi
// read the new audio data from the native AudioRecord object // read the new audio data from the native AudioRecord object
const size_t recorderBuffSize = lpRecorder->frameCount()*lpRecorder->frameSize(); const size_t recorderBuffSize = lpRecorder->frameCount()*lpRecorder->frameSize();
const size_t sizeInBytes = sizeInShorts * sizeof(short); const size_t sizeInBytes = sizeInShorts * sizeof(short);
ssize_t readSize = lpRecorder->read(recordBuff + offsetInShorts * sizeof(short), ssize_t readSize = lpRecorder->read(recordBuff + offsetInShorts,
sizeInBytes > recorderBuffSize ? sizeInBytes > recorderBuffSize ?
recorderBuffSize : sizeInBytes); recorderBuffSize : sizeInBytes);