summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/CameraSource.cpp
diff options
context:
space:
mode:
authorPraveen Chavan <pchavan@codeaurora.org>2015-10-01 19:05:19 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-10-07 02:00:24 -0700
commitfc7a0312dd2a9dfc0c084e70b5898438875958f0 (patch)
treeb767cb0d276e0392e63aa0cfdeb663e396702c11 /media/libstagefright/CameraSource.cpp
parentb3f0834aa448d6b4bf8dbddaff4fbcefa3ede422 (diff)
downloadframeworks_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
Diffstat (limited to 'media/libstagefright/CameraSource.cpp')
-rw-r--r--media/libstagefright/CameraSource.cpp5
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;
}