]> git.sesse.net Git - vlc/commitdiff
avcodec: do not flush buffers if codec hasn't been opened
authorRafaël Carré <rafael.carre@gmail.com>
Mon, 26 Oct 2009 12:55:24 +0000 (13:55 +0100)
committerRafaël Carré <rafael.carre@gmail.com>
Mon, 26 Oct 2009 12:56:11 +0000 (13:56 +0100)
Reported-by: Konstantin Pavlov (thresh)
modules/codec/avcodec/video.c

index ea3729145c23634442991a20571cac1d4e8daf3c..e1e468690df0f4b8579cda5c1a7640182419e68b 100644 (file)
@@ -715,7 +715,9 @@ void EndVideoDec( decoder_t *p_dec )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 
-    avcodec_flush_buffers( p_sys->p_context );
+    /* do not flush buffers if codec hasn't been opened (theora/vorbis/VC1) */
+    if( p_sys->p_context->codec )
+        avcodec_flush_buffers( p_sys->p_context );
 
     if( p_sys->p_ff_pic ) av_free( p_sys->p_ff_pic );