diff options
author | SathishKumar Mani <smani@codeaurora.org> | 2015-09-25 18:17:46 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:25:11 -0600 |
commit | 4d0485d7daead3a28cac12c2e2cea25c2ade654d (patch) | |
tree | f491ca8ce40faf88c01b2a043ea70f652c095ebb /services/audioflinger/BufferProviders.cpp | |
parent | 197cd79c6314ac2e14ce94624e21f3c4e38dca7c (diff) | |
download | frameworks_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/BufferProviders.cpp')
-rw-r--r-- | services/audioflinger/BufferProviders.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/services/audioflinger/BufferProviders.cpp b/services/audioflinger/BufferProviders.cpp index a8be206..434a514 100644 --- a/services/audioflinger/BufferProviders.cpp +++ b/services/audioflinger/BufferProviders.cpp @@ -24,6 +24,7 @@ #include <media/EffectsFactoryApi.h> #include <utils/Log.h> +#include <media/stagefright/foundation/ADebug.h> #include "Configuration.h" #include "BufferProviders.h" @@ -205,6 +206,7 @@ DownmixerBufferProvider::DownmixerBufferProvider( const int downmixParamSize = sizeof(effect_param_t) + psizePadded + sizeof(downmix_type_t); effect_param_t * const param = (effect_param_t *) malloc(downmixParamSize); + CHECK(param != NULL); param->psize = sizeof(downmix_params_t); const downmix_params_t downmixParam = DOWNMIX_PARAM_TYPE; memcpy(param->data, &downmixParam, param->psize); |