diff options
author | Kim Zhang <xiazhang@codeaurora.org> | 2015-03-31 13:56:10 +0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2015-11-07 01:38:42 -0800 |
commit | df287f605d5fcc75f439411917bfd9e1d82c7f1a (patch) | |
tree | edbcdf6f0bda13a7248f576ab91ccdff5950b765 /media/libstagefright/MediaCodecSource.cpp | |
parent | eb18dd6921c6805a9f795af6a981fc83bb8e3e07 (diff) | |
download | frameworks_av-df287f605d5fcc75f439411917bfd9e1d82c7f1a.zip frameworks_av-df287f605d5fcc75f439411917bfd9e1d82c7f1a.tar.gz frameworks_av-df287f605d5fcc75f439411917bfd9e1d82c7f1a.tar.bz2 |
libstagefright: add NULL check in MediaCodecSource's puller
When CameraSource/AudioSource is stopped, puller will read a NULL buffer
with success, so we should add NULL check before release it.
Change-Id: I8924167fc79c7880e80115aafbb9cc7c3e9e885c
CRs-Fixed: 813924
(cherry picked from commit 3dfbe3ae49c44301a8d484c2c5aaf0c8e1b53203)
Diffstat (limited to 'media/libstagefright/MediaCodecSource.cpp')
-rw-r--r-- | media/libstagefright/MediaCodecSource.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libstagefright/MediaCodecSource.cpp b/media/libstagefright/MediaCodecSource.cpp index 925be14..aef6715 100644 --- a/media/libstagefright/MediaCodecSource.cpp +++ b/media/libstagefright/MediaCodecSource.cpp @@ -216,7 +216,7 @@ void MediaCodecSource::Puller::onMessageReceived(const sp<AMessage> &msg) { status_t err = mSource->read(&mbuf); if (mPaused) { - if (err == OK) { + if (err == OK && (NULL != mbuf)) { mbuf->release(); mbuf = NULL; } |