diff options
author | Amit Shekhar <ashekhar@codeaurora.org> | 2015-09-17 15:51:35 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-10-21 12:25:31 -0700 |
commit | 91ba994751d54026381d7718efbcc849a75c20fe (patch) | |
tree | 9a723e1533612c5b414e064200e0f9b41ab50d19 | |
parent | dc8d9caa08290a0907c23c7874bdca8b2d721634 (diff) | |
download | frameworks_av-91ba994751d54026381d7718efbcc849a75c20fe.zip frameworks_av-91ba994751d54026381d7718efbcc849a75c20fe.tar.gz frameworks_av-91ba994751d54026381d7718efbcc849a75c20fe.tar.bz2 |
nuplayer: Fix de-referencing NULL mSource
InstantiateDecoderAction is executed after performing reset.
By the time performReset call is over, mSource is cleared and
instantiateDecoderAction is executed on a NULL mSource - causing
crash. At this point of time, mSource is already reset and it is
not intended to be used in future, so, we can safely return.
Check for NULL to avoid crash.
CRs-Fixed: 902831
Change-Id: If438da2b8c778c6db3640c0bc2e53d3ef68d286c
-rw-r--r-- | media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 356c519..6305a02 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -1526,7 +1526,10 @@ status_t NuPlayer::instantiateDecoder(bool audio, sp<DecoderBase> *decoder) { if (*decoder != NULL || (audio && mFlushingAudio == SHUT_DOWN)) { return OK; } - + if (mSource == NULL) { + ALOGD("%s Ignore instantiate decoder after clearing source", __func__); + return INVALID_OPERATION; + } sp<AMessage> format = mSource->getFormat(audio); if (format == NULL) { |