Commit 29e7fc71 authored by Anthony Loiseau's avatar Anthony Loiseau Committed by Rémi Duraffort

codec/libass: avoid possible segfault

dialog_ProgressCreate can return NULL. For this case,
only deal with the result if it is not NULL.
Signed-off-by: default avatarRémi Duraffort <ivoire@videolan.org>
parent 6a616fca
...@@ -724,6 +724,7 @@ static ass_handle_t *AssHandleHold( decoder_t *p_dec ) ...@@ -724,6 +724,7 @@ static ass_handle_t *AssHandleHold( decoder_t *p_dec )
ass_set_fonts_dir( p_library, psz_font_dir ); ass_set_fonts_dir( p_library, psz_font_dir );
free( psz_font_dir ); free( psz_font_dir );
#ifdef WIN32 #ifdef WIN32
if( p_dialog )
dialog_ProgressSet( p_dialog, NULL, 0.1 ); dialog_ProgressSet( p_dialog, NULL, 0.1 );
#endif #endif
...@@ -747,6 +748,7 @@ static ass_handle_t *AssHandleHold( decoder_t *p_dec ) ...@@ -747,6 +748,7 @@ static ass_handle_t *AssHandleHold( decoder_t *p_dec )
#ifdef HAVE_FONTCONFIG #ifdef HAVE_FONTCONFIG
#ifdef WIN32 #ifdef WIN32
if( p_dialog )
dialog_ProgressSet( p_dialog, NULL, 0.2 ); dialog_ProgressSet( p_dialog, NULL, 0.2 );
#endif #endif
#if defined( LIBASS_VERSION ) && LIBASS_VERSION >= 0x00907000 #if defined( LIBASS_VERSION ) && LIBASS_VERSION >= 0x00907000
...@@ -755,6 +757,7 @@ static ass_handle_t *AssHandleHold( decoder_t *p_dec ) ...@@ -755,6 +757,7 @@ static ass_handle_t *AssHandleHold( decoder_t *p_dec )
ass_set_fonts( p_renderer, psz_font, psz_family ); // setup default font/family ass_set_fonts( p_renderer, psz_font, psz_family ); // setup default font/family
#endif #endif
#ifdef WIN32 #ifdef WIN32
if( p_dialog )
dialog_ProgressSet( p_dialog, NULL, 1.0 ); dialog_ProgressSet( p_dialog, NULL, 1.0 );
#endif #endif
#else #else
...@@ -774,6 +777,7 @@ static ass_handle_t *AssHandleHold( decoder_t *p_dec ) ...@@ -774,6 +777,7 @@ static ass_handle_t *AssHandleHold( decoder_t *p_dec )
/* */ /* */
vlc_mutex_unlock( &libass_lock ); vlc_mutex_unlock( &libass_lock );
#ifdef WIN32 #ifdef WIN32
if( p_dialog )
dialog_ProgressDestroy( p_dialog ); dialog_ProgressDestroy( p_dialog );
#endif #endif
return p_ass; return p_ass;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment