diff options
author | Praveen Chavan <pchavan@codeaurora.org> | 2015-10-01 19:05:19 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-10-07 02:00:24 -0700 |
commit | fc7a0312dd2a9dfc0c084e70b5898438875958f0 (patch) | |
tree | b767cb0d276e0392e63aa0cfdeb663e396702c11 | |
parent | b3f0834aa448d6b4bf8dbddaff4fbcefa3ede422 (diff) | |
download | frameworks_av-fc7a0312dd2a9dfc0c084e70b5898438875958f0.zip frameworks_av-fc7a0312dd2a9dfc0c084e70b5898438875958f0.tar.gz frameworks_av-fc7a0312dd2a9dfc0c084e70b5898438875958f0.tar.bz2 |
Stagefright: add a NULL check before accessing camera params
Camera may return NULL params if the remote object is dead.
Check for NULL and report error rather than crash.
Change-Id: Id1fcd04dc187aadf00ca4ec5e48fb495c3369c92
CRs-Fixed: 906099
-rw-r--r-- | media/libstagefright/CameraSource.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp index 41513fb..27a6086 100644 --- a/media/libstagefright/CameraSource.cpp +++ b/media/libstagefright/CameraSource.cpp @@ -100,6 +100,11 @@ void CameraSourceListener::postDataTimestamp( } static int32_t getColorFormat(const char* colorFormat) { + if (!colorFormat) { + ALOGE("Invalid color format"); + return -1; + } + if (!strcmp(colorFormat, CameraParameters::PIXEL_FORMAT_YUV420P)) { return OMX_COLOR_FormatYUV420Planar; } |