From d6a720cb351211eb36303f18340a9889223f6f7e Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Sun, 18 Sep 2005 12:58:25 +0000 Subject: [PATCH] misc possible buffer/resource misuse & tidy compilation --- modules/codec/ffmpeg/encoder.c | 2 +- modules/codec/ffmpeg/ffmpeg.c | 6 +++--- src/misc/threads.c | 3 +++ src/playlist/view.c | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/codec/ffmpeg/encoder.c b/modules/codec/ffmpeg/encoder.c index a341cf936f..8a1b542b43 100644 --- a/modules/codec/ffmpeg/encoder.c +++ b/modules/codec/ffmpeg/encoder.c @@ -33,7 +33,7 @@ #include /* ffmpeg header */ -#define HAVE_MMX +#define HAVE_MMX 1 #ifdef HAVE_FFMPEG_AVCODEC_H # include #else diff --git a/modules/codec/ffmpeg/ffmpeg.c b/modules/codec/ffmpeg/ffmpeg.c index 86808ad32e..a978a27d5c 100644 --- a/modules/codec/ffmpeg/ffmpeg.c +++ b/modules/codec/ffmpeg/ffmpeg.c @@ -29,7 +29,7 @@ #include /* ffmpeg header */ -#define HAVE_MMX +#define HAVE_MMX 1 #ifdef HAVE_FFMPEG_AVCODEC_H # include #else @@ -360,8 +360,8 @@ static void LibavcodecCallback( void *p_opaque, int i_level, psz_item_name = p_avc->item_name(p_opaque); psz_new_format = malloc( strlen(psz_format) + strlen(psz_item_name) + 18 + 5 ); - sprintf( psz_new_format, "%s (%s@%p)", psz_format, - p_avc->item_name(p_opaque), p_opaque ); + snprintf( psz_new_format, strlen(psz_format) + strlen(psz_item_name) + + 18 + 5, "%s (%s@%p)", psz_format, p_avc->item_name(p_opaque), p_opaque ); msg_GenericVa( p_this, i_vlc_level, MODULE_STRING, psz_new_format, va ); free( psz_new_format ); } diff --git a/src/misc/threads.c b/src/misc/threads.c index 9b2eb3d73e..ca0fdac13b 100644 --- a/src/misc/threads.c +++ b/src/misc/threads.c @@ -483,6 +483,9 @@ int __vlc_cond_destroy( char * psz_file, int i_line, vlc_cond_t *p_condvar ) i_result = !CloseHandle( p_condvar->event ) || !CloseHandle( p_condvar->semaphore ); + if( p_condvar->semaphore != NULL ) + DeleteCriticalSection( &p_condvar->csection ); + #elif defined( HAVE_KERNEL_SCHEDULER_H ) p_condvar->init = 0; return 0; diff --git a/src/playlist/view.c b/src/playlist/view.c index 3ae05fdc73..b963d083e1 100644 --- a/src/playlist/view.c +++ b/src/playlist/view.c @@ -301,6 +301,7 @@ playlist_item_t * playlist_NodeCreate( playlist_t *p_playlist, int i_view, p_item->pp_parents = NULL; p_item->i_parents = 0; + p_item->i_serial = 0; p_item->i_flags |= PLAYLIST_SKIP_FLAG; /* Default behaviour */ -- 2.39.2