summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2016-01-12 02:07:13 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-01-12 02:07:13 +0000
commitb1338d3cfcb47d0fc5f21e2b939d66316b307fe3 (patch)
tree1261604575864a75daa95d71146e28ef49f2ae6b /media
parent2c59cc083d471fe55abc61870d05952bd242b738 (diff)
parent68e43cf141a5851c242bce776dff93f7136cbea6 (diff)
downloadframeworks_av-b1338d3cfcb47d0fc5f21e2b939d66316b307fe3.zip
frameworks_av-b1338d3cfcb47d0fc5f21e2b939d66316b307fe3.tar.gz
frameworks_av-b1338d3cfcb47d0fc5f21e2b939d66316b307fe3.tar.bz2
fix possible overflow in effect wrappers. am: 9e29523b95 am: baebc739b0 am: 3a9d4f4a83 am: 5b7c20dd1e am: df81fc3f3c
am: 68e43cf141 * commit '68e43cf141a5851c242bce776dff93f7136cbea6': fix possible overflow in effect wrappers.
Diffstat (limited to 'media')
-rw-r--r--media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp5
-rw-r--r--media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
index 40c7fef..86ce27a 100644
--- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
@@ -3053,7 +3053,10 @@ int Effect_command(effect_handle_t self,
//ALOGV("\tEffect_command cmdCode Case: EFFECT_CMD_GET_PARAM start");
effect_param_t *p = (effect_param_t *)pCmdData;
-
+ if (SIZE_MAX - sizeof(effect_param_t) < (size_t)p->psize) {
+ android_errorWriteLog(0x534e4554, "26347509");
+ return -EINVAL;
+ }
if (pCmdData == NULL || cmdSize < sizeof(effect_param_t) ||
cmdSize < (sizeof(effect_param_t) + p->psize) ||
pReplyData == NULL || replySize == NULL ||
diff --git a/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp b/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp
index a48a4e3..4dc8b45 100644
--- a/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp
+++ b/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp
@@ -1956,7 +1956,10 @@ int Reverb_command(effect_handle_t self,
//ALOGV("\tReverb_command cmdCode Case: "
// "EFFECT_CMD_GET_PARAM start");
effect_param_t *p = (effect_param_t *)pCmdData;
-
+ if (SIZE_MAX - sizeof(effect_param_t) < (size_t)p->psize) {
+ android_errorWriteLog(0x534e4554, "26347509");
+ return -EINVAL;
+ }
if (pCmdData == NULL || cmdSize < sizeof(effect_param_t) ||
cmdSize < (sizeof(effect_param_t) + p->psize) ||
pReplyData == NULL || replySize == NULL ||