diff options
author | Suman Mukherjee <sumam@codeaurora.org> | 2015-01-12 12:35:11 +0530 |
---|---|---|
committer | Ethan Chen <intervigil@gmail.com> | 2015-02-09 21:59:58 +0000 |
commit | e6b9af44182cfa3fd3540d98c7fab1fc7523b898 (patch) | |
tree | a63ca817dc214105e2767554edb49d905e2787fd | |
parent | 53b672b25082c838a08e5ec6fb802757de6ff858 (diff) | |
download | frameworks_av-e6b9af44182cfa3fd3540d98c7fab1fc7523b898.tar.gz frameworks_av-e6b9af44182cfa3fd3540d98c7fab1fc7523b898.tar.bz2 frameworks_av-e6b9af44182cfa3fd3540d98c7fab1fc7523b898.zip |
Camera: Added null check for memory reference
Null memory reference in releaseRecordingFrame will cause
crash in cfuzz tool.
Added Null check for memory reference
Change-Id: Id15fc55cc89b6039a36c1c3c7e4b55c0ae5aa296
-rw-r--r-- | services/camera/libcameraservice/device1/CameraHardwareInterface.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/device1/CameraHardwareInterface.h b/services/camera/libcameraservice/device1/CameraHardwareInterface.h index 89322eacba..a49e45e26d 100644 --- a/services/camera/libcameraservice/device1/CameraHardwareInterface.h +++ b/services/camera/libcameraservice/device1/CameraHardwareInterface.h @@ -341,6 +341,10 @@ public: void releaseRecordingFrame(const sp<IMemory>& mem) { ALOGV("%s(%s)", __FUNCTION__, mName.string()); + if (mem == NULL) { + ALOGE("%s: NULL memory reference", __FUNCTION__); + return; + } if (mDevice->ops->release_recording_frame) { ssize_t offset; size_t size; |