[vlc-commits] codec: x264: avoid segfault with x264_encoder_delayed_frames

Francois Cartegnie git at videolan.org
Fri Aug 9 10:33:11 CEST 2013


vlc/vlc-2.1 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Aug  6 22:12:47 2013 +0200| [80b0dd5f36d616f9843b73511452dd05a3730538] | committer: Jean-Baptiste Kempf

codec: x264: avoid segfault with x264_encoder_delayed_frames

(cherry picked from commit 4b08ccc55994b39760ee7cb1d1e3b2da076730ec)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=80b0dd5f36d616f9843b73511452dd05a3730538
---

 modules/codec/x264.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/codec/x264.c b/modules/codec/x264.c
index 14be85a..5287746 100644
--- a/modules/codec/x264.c
+++ b/modules/codec/x264.c
@@ -1532,10 +1532,11 @@ static void Close( vlc_object_t *p_this )
     free( p_sys->psz_stat_name );
     free( p_sys->p_sei );
 
-    msg_Dbg( p_enc, "framecount still in libx264 buffer: %d", x264_encoder_delayed_frames( p_sys->h ) );
-
     if( p_sys->h )
+    {
+        msg_Dbg( p_enc, "framecount still in libx264 buffer: %d", x264_encoder_delayed_frames( p_sys->h ) );
         x264_encoder_close( p_sys->h );
+    }
 
 #ifdef PTW32_STATIC_LIB
     vlc_mutex_lock( &pthread_win32_mutex );



More information about the vlc-commits mailing list