[vlc-devel] commit: codec/libass: avoid possible segfault (Anthony Loiseau )
git version control
git at videolan.org
Tue Jul 28 19:15:16 CEST 2009
vlc | branch: 1.0-bugfix | Anthony Loiseau <thannoy at actech-innovation.com> | Tue Jul 28 16:46:54 2009 +0200| [03212d87b4b8ff5a09c80106d1e21e15a9869586] | committer: 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: Rémi Duraffort <ivoire at videolan.org>
(cherry picked from commit 29e7fc71082c08aec51d438b3d8564e25526b2d1)
Signed-off-by: Rémi Duraffort <ivoire at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=03212d87b4b8ff5a09c80106d1e21e15a9869586
---
modules/codec/libass.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/modules/codec/libass.c b/modules/codec/libass.c
index 0a9fced..8b8ec23 100644
--- a/modules/codec/libass.c
+++ b/modules/codec/libass.c
@@ -731,7 +731,8 @@ static ass_handle_t *AssHandleHold( decoder_t *p_dec )
ass_set_fonts_dir( p_library, psz_font_dir );
free( psz_font_dir );
#ifdef WIN32
- dialog_ProgressSet( p_dialog, NULL, 0.1 );
+ if( p_dialog )
+ dialog_ProgressSet( p_dialog, NULL, 0.1 );
#endif
ass_set_extract_fonts( p_library, true );
@@ -754,7 +755,8 @@ static ass_handle_t *AssHandleHold( decoder_t *p_dec )
#ifdef HAVE_FONTCONFIG
#ifdef WIN32
- dialog_ProgressSet( p_dialog, NULL, 0.2 );
+ if( p_dialog )
+ dialog_ProgressSet( p_dialog, NULL, 0.2 );
#endif
#if defined( LIBASS_VERSION ) && LIBASS_VERSION >= 0x00907000
ass_set_fonts( p_renderer, psz_font, psz_family, true, NULL, 1 ); // setup default font/family
@@ -762,7 +764,8 @@ static ass_handle_t *AssHandleHold( decoder_t *p_dec )
ass_set_fonts( p_renderer, psz_font, psz_family ); // setup default font/family
#endif
#ifdef WIN32
- dialog_ProgressSet( p_dialog, NULL, 1.0 );
+ if( p_dialog )
+ dialog_ProgressSet( p_dialog, NULL, 1.0 );
#endif
#else
/* FIXME you HAVE to give him a font if no fontconfig */
@@ -781,7 +784,8 @@ static ass_handle_t *AssHandleHold( decoder_t *p_dec )
/* */
vlc_mutex_unlock( &libass_lock );
#ifdef WIN32
- dialog_ProgressDestroy( p_dialog );
+ if( p_dialog )
+ dialog_ProgressDestroy( p_dialog );
#endif
return p_ass;
More information about the vlc-devel
mailing list