stagefright: add null guard for CameraSource::stopCameraRecording
Bug: 27120259
Change-Id: I2e081404fa4a74b286918374e7da8361c0f59d22
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/CameraSource.cpp
index d302f82..64d4302 100644
--- a/media/libstagefright/CameraSource.cpp
+++ b/media/libstagefright/CameraSource.cpp
@@ -792,10 +792,14 @@
void CameraSource::stopCameraRecording() {
ALOGV("stopCameraRecording");
if (mCameraFlags & FLAGS_HOT_CAMERA) {
- mCameraRecordingProxy->stopRecording();
+ if (mCameraRecordingProxy != 0) {
+ mCameraRecordingProxy->stopRecording();
+ }
} else {
- mCamera->setListener(NULL);
- mCamera->stopRecording();
+ if (mCamera != 0) {
+ mCamera->setListener(NULL);
+ mCamera->stopRecording();
+ }
}
}