From 4d0485d7daead3a28cac12c2e2cea25c2ade654d Mon Sep 17 00:00:00 2001 From: SathishKumar Mani Date: Fri, 25 Sep 2015 18:17:46 -0700 Subject: Stagefright: Add Checks for allocations Warn allocation failures explicitly rather than crash trying to access unallocated memory Change-Id: Ie86c3ac130917e1f4030eb8207ac8350cba7711d --- media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'media/libeffects') diff --git a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp index ad7ca4a..e01c414 100644 --- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp +++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp @@ -29,6 +29,7 @@ #include "EffectBundle.h" #include "math.h" +#include // effect_handle_t interface implementation for bass boost extern "C" const struct effect_interface_s gLvmEffectInterface; @@ -563,6 +564,7 @@ int LvmBundle_init(EffectContext *pContext){ for (int i=0; ipBundledContext->workBuffer = (LVM_INT16 *)malloc(frameCount * sizeof(LVM_INT16) * 2); + CHECK(pContext->pBundledContext->workBuffer != NULL); pContext->pBundledContext->frameCount = frameCount; } pOutTmp = pContext->pBundledContext->workBuffer; -- cgit v1.1