summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorVladimir Petrov <vppetrov@mm-sol.com>2012-07-13 13:42:10 +0300
committerDaniel Levin <dendy@ti.com>2012-11-26 18:22:44 +0200
commit129ab1fdb33f91d9005e775fabbd2bf9e6d896df (patch)
tree08d34d11b14179fb9ef2fa22893264323d5a65a9 /test
parent6c928cda6a22e07d70bbc0e2ef880d6430adbe69 (diff)
downloadhardware_ti_omap4-129ab1fdb33f91d9005e775fabbd2bf9e6d896df.zip
hardware_ti_omap4-129ab1fdb33f91d9005e775fabbd2bf9e6d896df.tar.gz
hardware_ti_omap4-129ab1fdb33f91d9005e775fabbd2bf9e6d896df.tar.bz2
Camera_test: Check bracketing index array range
Checks the index passed to setDefaultExpGainPreset() before to use, to avoid memory corruption if script contains index which is out of range. Change-Id: I93c29b5da6e9d77232a7e45b56ad55be1481b90b Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
Diffstat (limited to 'test')
-rw-r--r--test/CameraHal/camera_test_menu.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/CameraHal/camera_test_menu.cpp b/test/CameraHal/camera_test_menu.cpp
index 4a42ede..db45eb0 100644
--- a/test/CameraHal/camera_test_menu.cpp
+++ b/test/CameraHal/camera_test_menu.cpp
@@ -2153,7 +2153,11 @@ void initDefaults() {
}
void setDefaultExpGainPreset(ShotParameters &params, int idx) {
- setExpGainPreset(params, expBracketing[idx].value, false, expBracketing[idx].param_type, shotConfigFlush);
+ if ( ((int)ARRAY_SIZE(expBracketing) > idx) && (0 <= idx) ) {
+ setExpGainPreset(params, expBracketing[idx].value, false, expBracketing[idx].param_type, shotConfigFlush);
+ } else {
+ printf("setDefaultExpGainPreset: Index (%d) is out of range 0 ~ %u\n", idx, ARRAY_SIZE(expBracketing) - 1);
+ }
}
void setSingleExpGainPreset(ShotParameters &params, int idx, int exp, int gain) {