summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorrago <rago@google.com>2016-10-07 18:16:09 -0700
committerJessica Wagantall <jwagantall@cyngn.com>2016-12-12 11:56:41 -0800
commit4e5f6633b573b1d076cda7e3390c021ea95aeea3 (patch)
treeb7137f0e550a98b15aada534eb53a74c195d0020 /media
parent26c5fa31d17a638bf314de6e12e86bb8a86db44b (diff)
downloadframeworks_av-4e5f6633b573b1d076cda7e3390c021ea95aeea3.zip
frameworks_av-4e5f6633b573b1d076cda7e3390c021ea95aeea3.tar.gz
frameworks_av-4e5f6633b573b1d076cda7e3390c021ea95aeea3.tar.bz2
Fix potential NULL dereference in Visualizer effect
CYNGNOS-3312 Bug: 30229821 Test: fixing CL. Existing unit tests still pass. Change-Id: I6e4abd759d5d2abc3b391e92e2e18f060cab7af0 (cherry picked from commit 874f9e0b8eb0cbe508d15c8c03796c863851f21f) (cherry picked from commit 244e7fd2a45b4e7d70d2c2e550181220371b7edf)
Diffstat (limited to 'media')
-rw-r--r--media/libeffects/visualizer/EffectVisualizer.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/media/libeffects/visualizer/EffectVisualizer.cpp b/media/libeffects/visualizer/EffectVisualizer.cpp
index 91f9fc7..21fddb1 100644
--- a/media/libeffects/visualizer/EffectVisualizer.cpp
+++ b/media/libeffects/visualizer/EffectVisualizer.cpp
@@ -602,9 +602,14 @@ int Visualizer_command(effect_handle_t self, uint32_t cmdCode, uint32_t cmdSize,
case VISUALIZER_CMD_MEASURE: {
if (pReplyData == NULL || replySize == NULL ||
*replySize < (sizeof(int32_t) * MEASUREMENT_COUNT)) {
- ALOGV("VISUALIZER_CMD_MEASURE() error *replySize %" PRIu32
- " < (sizeof(int32_t) * MEASUREMENT_COUNT) %" PRIu32, *replySize,
- sizeof(int32_t) * MEASUREMENT_COUNT);
+ if (replySize == NULL) {
+ ALOGV("VISUALIZER_CMD_MEASURE() error replySize NULL");
+ } else {
+ ALOGV("VISUALIZER_CMD_MEASURE() error *replySize %" PRIu32
+ " < (sizeof(int32_t) * MEASUREMENT_COUNT) %" PRIu32,
+ *replySize,
+ uint32_t(sizeof(int32_t)) * MEASUREMENT_COUNT);
+ }
android_errorWriteLog(0x534e4554, "30229821");
return -EINVAL;
}