diff options
author | Glenn Kasten <gkasten@google.com> | 2011-01-25 09:26:11 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2011-01-26 13:21:39 -0800 |
commit | 4c2bc0fd150b0164f9f387214c29143346a92e14 (patch) | |
tree | 679aec17692e7a7de43cdcca3da7b6a365265aa8 | |
parent | 062b7b45b27c6bfffc494af21382d7fa7a8d2d82 (diff) | |
download | android_system_media-gingerbread.tar.gz android_system_media-gingerbread.tar.bz2 android_system_media-gingerbread.zip |
Bug 3388299 Fix stack buffer overruncm-7.1.0gingerbread-releasegingerbreadgb-release-7.2
Change-Id: Ie8c525ddee862b32f2055cb89c10a680f0c14f97
-rw-r--r-- | opensles/libopensles/android_Effect.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/opensles/libopensles/android_Effect.cpp b/opensles/libopensles/android_Effect.cpp index 1bc0a9e7..85dc7c87 100644 --- a/opensles/libopensles/android_Effect.cpp +++ b/opensles/libopensles/android_Effect.cpp @@ -32,6 +32,8 @@ static const int ENVREVERB_PARAM_SIZE_MAX_SINGLE = sizeof(effect_param_t) + 2 * static const int ENVREVERB_PARAM_SIZE_MAX_ALL = sizeof(effect_param_t) + sizeof(int32_t) + sizeof(s_reverb_settings); +static const int PRESETREVERB_PARAM_SIZE_MAX = sizeof(effect_param_t) + 2 * sizeof(int32_t); + static inline SLuint32 KEY_FROM_GUID(SLInterfaceID pUuid) { return pUuid->time_low; } @@ -389,8 +391,8 @@ void android_prev_init(IPresetReverb* ipr) { //----------------------------------------------------------------------------- android::status_t android_prev_setPreset(android::sp<android::AudioEffect> pFx, uint16_t preset) { - android::status_t status = android_fx_setParam(pFx, REVERB_PARAM_PRESET, sizeof(uint16_t), - &preset, sizeof(uint16_t)); + android::status_t status = android_fx_setParam(pFx, REVERB_PARAM_PRESET, + PRESETREVERB_PARAM_SIZE_MAX, &preset, sizeof(uint16_t)); // enable the effect if the preset is different from SL_REVERBPRESET_NONE pFx->setEnabled(SL_REVERBPRESET_NONE != preset); return status; @@ -398,7 +400,7 @@ android::status_t android_prev_setPreset(android::sp<android::AudioEffect> pFx, //----------------------------------------------------------------------------- android::status_t android_prev_getPreset(android::sp<android::AudioEffect> pFx, uint16_t* preset) { - return android_fx_getParam(pFx, REVERB_PARAM_PRESET, sizeof(uint16_t), preset, + return android_fx_getParam(pFx, REVERB_PARAM_PRESET, PRESETREVERB_PARAM_SIZE_MAX, preset, sizeof(uint16_t)); } |