diff options
author | Steve Kondik <shade@chemlab.org> | 2013-05-01 02:58:11 -0700 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2015-10-17 02:40:30 -0700 |
commit | e67b624a7f64d702fde241624724785eafa67645 (patch) | |
tree | b2858b9cd0197fe77f46515f8b9d8ccb27b57efb /camera | |
parent | 70e359f102a3c40cad45ff9ce5a2b3bcdb429658 (diff) | |
download | frameworks_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.cpp | 3 |
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 ¶ms) 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); |