summaryrefslogtreecommitdiffstats
path: root/include/media/AudioRecord.h
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2013-08-09 18:32:30 -0700
committerJeff Brown <jeffbrown@google.com>2013-08-09 19:57:53 -0700
commitac0bbe16f3eba46b3d8057b66c2aff9101fc6f7d (patch)
tree14008bb60b6b0ac3eb77b8e39504400d2b446e43 /include/media/AudioRecord.h
parent1b832c3d8f2b1b24f9bc7025afd2b4a8b4e6c6f9 (diff)
downloadframeworks_av-ac0bbe16f3eba46b3d8057b66c2aff9101fc6f7d.zip
frameworks_av-ac0bbe16f3eba46b3d8057b66c2aff9101fc6f7d.tar.gz
frameworks_av-ac0bbe16f3eba46b3d8057b66c2aff9101fc6f7d.tar.bz2
Fix potential leak of audio input handle.
The audio input handle is ultimately owned by the audio recorder object but it could be dropped on the floor if an error occurred before that object was fully initialized. Rearranged some of the argument validation and merged getInput_l with openRecord_l to simplify the code and prevent such a leak from occurring. Bug: 10265163 Change-Id: I124dce344b1d11c2dd66ca5e2c9aec0c52c230e2
Diffstat (limited to 'include/media/AudioRecord.h')
-rw-r--r--include/media/AudioRecord.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index f457261..62f0c64 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -423,14 +423,7 @@ private:
nsecs_t processAudioBuffer(const sp<AudioRecordThread>& thread);
// caller must hold lock on mLock for all _l methods
- status_t openRecord_l(uint32_t sampleRate,
- audio_format_t format,
- size_t frameCount,
- audio_input_flags_t flags,
- audio_io_handle_t input,
- size_t epoch);
-
- audio_io_handle_t getInput_l();
+ status_t openRecord_l(size_t epoch);
// FIXME enum is faster than strcmp() for parameter 'from'
status_t restoreRecord_l(const char *from);