OSDN Git Service
(root)
/
android-x86
/
frameworks-av.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df49efa
)
Fix a segfault in AudioFlinger.
author
John Grossman
<johngro@google.com>
Thu, 9 Feb 2012 19:28:36 +0000
(11:28 -0800)
committer
John Grossman
<johngro@google.com>
Thu, 9 Feb 2012 19:31:06 +0000
(11:31 -0800)
Check the string returned by a HAL's implementation of get_parameters
for NULL before attempting to make use of it. That way, we won't
bring down the mediaserver because of a poorly written HAL.
Change-Id: I45f0fd3de003151f98acf32c36c42f58d053f3a0
services/audioflinger/AudioFlinger.cpp
patch
|
blob
|
history
diff --git
a/services/audioflinger/AudioFlinger.cpp
b/services/audioflinger/AudioFlinger.cpp
index
765d9b2
..
dbad3d9
100644
(file)
--- a/
services/audioflinger/AudioFlinger.cpp
+++ b/
services/audioflinger/AudioFlinger.cpp
@@
-923,7
+923,7
@@
String8 AudioFlinger::getParameters(int ioHandle, const String8& keys)
for (size_t i = 0; i < mAudioHwDevs.size(); i++) {
audio_hw_device_t *dev = mAudioHwDevs[i];
char *s = dev->get_parameters(dev, keys.string());
- out_s8 += String8(s);
+ out_s8 += String8(s
? s : ""
);
free(s);
}
return out_s8;