summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.cpp
diff options
context:
space:
mode:
authorSathishKumar Mani <smani@codeaurora.org>2015-09-25 18:17:46 -0700
committerLinux Build Service Account <lnxbuild@localhost>2015-10-06 03:25:11 -0600
commit4d0485d7daead3a28cac12c2e2cea25c2ade654d (patch)
treef491ca8ce40faf88c01b2a043ea70f652c095ebb /services/audioflinger/AudioFlinger.cpp
parent197cd79c6314ac2e14ce94624e21f3c4e38dca7c (diff)
downloadframeworks_av-4d0485d7daead3a28cac12c2e2cea25c2ade654d.zip
frameworks_av-4d0485d7daead3a28cac12c2e2cea25c2ade654d.tar.gz
frameworks_av-4d0485d7daead3a28cac12c2e2cea25c2ade654d.tar.bz2
Stagefright: Add Checks for allocations
Warn allocation failures explicitly rather than crash trying to access unallocated memory Change-Id: Ie86c3ac130917e1f4030eb8207ac8350cba7711d
Diffstat (limited to 'services/audioflinger/AudioFlinger.cpp')
-rw-r--r--services/audioflinger/AudioFlinger.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 5089bd3..c7f863b 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2986,6 +2986,7 @@ void AudioFlinger::dumpTee(int fd, const sp<NBAIO_Source>& source, audio_io_hand
bool firstRead = true;
#define TEE_SINK_READ 1024 // frames per I/O operation
void *buffer = malloc(TEE_SINK_READ * frameSize);
+ CHECK (buffer != NULL);
for (;;) {
size_t count = TEE_SINK_READ;
ssize_t actual = teeSource->read(buffer, count,