From: Seoyeon Kim Date: Fri, 8 Sep 2017 02:02:52 +0000 (+0900) Subject: [4.0] Fix SVACE issues X-Git-Tag: accepted/tizen/4.0/unified/20170918.093603^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=20f3e124e28f6d61ad514ef1b40a335944f3d755 [4.0] Fix SVACE issues - Check NULL dereference at window-impl-ecore-wl.cpp:880, 1467 - Initialized member variables in TizenVideoPlayer - Fix the correct expression at image-operations.cpp:478 - Fix not to return NULL pointer at video-player-impl.cpp:136 Change-Id: I6ba410ab3406cca2a9b66c66345654c374278628 Signed-off-by: Seoyeon Kim --- diff --git a/adaptors/common/video-player-impl.cpp b/adaptors/common/video-player-impl.cpp index feab793..50e3e6b 100644 --- a/adaptors/common/video-player-impl.cpp +++ b/adaptors/common/video-player-impl.cpp @@ -133,7 +133,7 @@ std::string VideoPlayer::GetUrl() return mPlugin->GetUrl(); } - return std::string( NULL ); + return std::string(); } void VideoPlayer::SetLooping(bool looping) diff --git a/adaptors/ecore/wayland/window-impl-ecore-wl.cpp b/adaptors/ecore/wayland/window-impl-ecore-wl.cpp index 6f785d0..971be10 100644 --- a/adaptors/ecore/wayland/window-impl-ecore-wl.cpp +++ b/adaptors/ecore/wayland/window-impl-ecore-wl.cpp @@ -877,7 +877,10 @@ bool Window::IsVisible() const void Window::RotationDone( int orientation, int width, int height ) { ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) ); - wlSurface->RequestRotation( orientation, width, height ); + if( wlSurface ) + { + wlSurface->RequestRotation( orientation, width, height ); + } mAdaptor->SurfaceResizePrepare( Dali::Adaptor::SurfaceSize( width, height ) ); @@ -1461,7 +1464,10 @@ Dali::DevelWindow::WindowPosition Window::GetPosition() void Window::SetTransparency( bool transparent ) { ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) ); - wlSurface->SetTransparency( transparent ); + if( wlSurface ) + { + wlSurface->SetTransparency( transparent ); + } } } // Adaptor diff --git a/platform-abstractions/portable/image-operations.cpp b/platform-abstractions/portable/image-operations.cpp index 2c5da3b..e9a94cc 100644 --- a/platform-abstractions/portable/image-operations.cpp +++ b/platform-abstractions/portable/image-operations.cpp @@ -475,7 +475,7 @@ ImageDimensions CalculateDesiredDimensions( unsigned int bitmapWidth, unsigned i // If both dimensions have values requested, use them both: if( requestedWidth != 0 && requestedHeight != 0 ) { - if( requestedWidth <= maxSize && requestedWidth <= maxSize ) + if( requestedWidth <= maxSize && requestedHeight <= maxSize ) { return ImageDimensions( requestedWidth, requestedHeight ); } diff --git a/plugins/video-player/tizen-video-player.cpp b/plugins/video-player/tizen-video-player.cpp index f7baa50..e11736e 100644 --- a/plugins/video-player/tizen-video-player.cpp +++ b/plugins/video-player/tizen-video-player.cpp @@ -209,11 +209,18 @@ void LogPlayerError( int error ) } // unnamed namespace TizenVideoPlayer::TizenVideoPlayer() -: mPlayer( NULL ), +: mUrl(), + mPlayer( NULL ), mPlayerState( PLAYER_STATE_NONE ), mTbmSurface( NULL ), mPacket( NULL ), + mNativeImageSourcePtr( NULL ), + mTimer( NULL ), + mBackgroundColor( Vector4( 1.0f, 1.0f, 1.0f, 0.0f ) ), mTargetType( NativeImage ), + mPacketMutex(), + mPacketVector(), + mEcoreWlWindow( NULL ), mAlphaBitChanged( false ) { }