From: James Dong Date: Fri, 14 Sep 2012 22:34:35 +0000 (-0700) Subject: Fixed a native crash due to deref of a NULL pointer X-Git-Tag: android-x86-4.4-r1~23^2~80^2~11^2~152 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9f235b58cd6dbee74d091e437d520306977daac9;p=android-x86%2Fframeworks-av.git Fixed a native crash due to deref of a NULL pointer We only checked the mNativeWindow against NULL, but did not check the native window object itself against NULL. o related-to-bug: 7153683 Change-Id: I430d344dc09a2fc337bf51001551627056713773 --- diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index dc1e35149e..1ddf7750bd 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -963,7 +963,8 @@ sp NuPlayer::Source::getFormat(bool audio) { status_t NuPlayer::setVideoScalingMode(int32_t mode) { mVideoScalingMode = mode; - if (mNativeWindow != NULL) { + if (mNativeWindow != NULL + && mNativeWindow->getNativeWindow() != NULL) { status_t ret = native_window_set_scaling_mode( mNativeWindow->getNativeWindow().get(), mVideoScalingMode); if (ret != OK) {