From: taeyoon Date: Fri, 11 Nov 2016 02:52:51 +0000 (+0900) Subject: Fix null dereference in widget viewer dali X-Git-Tag: accepted/tizen/4.0/unified/20170920.081503~1^2~41 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2731782751e70e22b1e4caf4a9cfe354c8514220;p=platform%2Fcore%2Fuifw%2Fwidget-viewer-dali.git Fix null dereference in widget viewer dali Change-Id: I5d1e60016b6b16f67b71f71b0d96156dc40a6c02 --- diff --git a/internal/widget_view/widget_view_impl.cpp b/internal/widget_view/widget_view_impl.cpp index 7c2f44b..d3d5295 100644 --- a/internal/widget_view/widget_view_impl.cpp +++ b/internal/widget_view/widget_view_impl.cpp @@ -126,20 +126,22 @@ static void OnSurfaceUpdate( struct tizen_remote_surface* surface, wl_buffer* bu { Dali::WidgetView::Internal::WidgetView* widgetView = static_cast< Dali::WidgetView::Internal::WidgetView* >( data ); - if( widgetView && !widgetView->IsWidgetImageView() ) + if( widgetView ) { - tizen_remote_surface_transfer_visibility( surface, TIZEN_REMOTE_SURFACE_VISIBILITY_TYPE_VISIBLE); + if( !widgetView->IsWidgetImageView() ) + { + tizen_remote_surface_transfer_visibility( surface, TIZEN_REMOTE_SURFACE_VISIBILITY_TYPE_VISIBLE); - widgetView->CreateWidgetImageView(); - widgetView->ConnectSignal( surface ); - ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, OnKeyDown, surface ); - ecore_event_handler_add( ECORE_EVENT_KEY_UP, OnKeyUp, surface ); + widgetView->CreateWidgetImageView(); + widgetView->ConnectSignal( surface ); + ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, OnKeyDown, surface ); + ecore_event_handler_add( ECORE_EVENT_KEY_UP, OnKeyUp, surface ); + } + //get tbm surface from buffer + tbm_surface_h tbmSurface = static_cast< tbm_surface_h >( wl_buffer_get_user_data( buffer ) ); + widgetView->UpdateImageSource( tbmSurface ); } - - //get tbm surface from buffer - tbm_surface_h tbmSurface = static_cast< tbm_surface_h >( wl_buffer_get_user_data( buffer ) ); - widgetView->UpdateImageSource( tbmSurface ); } static void OnSurfaceMissing( struct tizen_remote_surface* surface, void* data )