summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2013-05-01 02:58:11 -0700
committerSteve Kondik <shade@chemlab.org>2015-10-17 02:40:30 -0700
commite67b624a7f64d702fde241624724785eafa67645 (patch)
treeb2858b9cd0197fe77f46515f8b9d8ccb27b57efb /camera
parent70e359f102a3c40cad45ff9ce5a2b3bcdb429658 (diff)
downloadframeworks_av-e67b624a7f64d702fde241624724785eafa67645.zip
frameworks_av-e67b624a7f64d702fde241624724785eafa67645.tar.gz
frameworks_av-e67b624a7f64d702fde241624724785eafa67645.tar.bz2
camera: Don't segfault if we get a NULL parameter
* Values end up NULL on some drivers, don't crash. Change-Id: Ic897dbd4629cf3af98c85f93be202c382dde806b
Diffstat (limited to 'camera')
-rw-r--r--camera/CameraParameters.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/camera/CameraParameters.cpp b/camera/CameraParameters.cpp
index 590ff4a..11f2fd1 100644
--- a/camera/CameraParameters.cpp
+++ b/camera/CameraParameters.cpp
@@ -242,6 +242,9 @@ void CameraParameters::unflatten(const String8 &params)
void CameraParameters::set(const char *key, const char *value)
{
+ if (key == NULL || value == NULL)
+ return;
+
// XXX i think i can do this with strspn()
if (strchr(key, '=') || strchr(key, ';')) {
//XXX ALOGE("Key \"%s\"contains invalid character (= or ;)", key);