diff options
author | Vladimir Petrov <vppetrov@mm-sol.com> | 2012-07-13 13:42:10 +0300 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-11-26 18:22:44 +0200 |
commit | 129ab1fdb33f91d9005e775fabbd2bf9e6d896df (patch) | |
tree | 08d34d11b14179fb9ef2fa22893264323d5a65a9 /test | |
parent | 6c928cda6a22e07d70bbc0e2ef880d6430adbe69 (diff) | |
download | hardware_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.cpp | 6 |
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 ¶ms, 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 ¶ms, int idx, int exp, int gain) { |