[vlc-commits] avcodec: handle NULL pp_block

Thomas Guillem git at videolan.org
Mon Dec 21 15:52:58 CET 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Dec 15 09:54:19 2015 +0100| [59e8639b15bdca68a852c0ca73da3620b150cc4c] | committer: Thomas Guillem

avcodec: handle NULL pp_block

Drain when pp_block is NULL.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=59e8639b15bdca68a852c0ca73da3620b150cc4c
---

 modules/codec/avcodec/video.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 6310f84..6b23375 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -530,9 +530,6 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
     int b_drawpicture;
     block_t *p_block;
 
-    if( !pp_block )
-        return NULL;
-
     if( !p_context->extradata_size && p_dec->fmt_in.i_extra )
     {
         ffmpeg_InitCodec( p_dec );
@@ -540,7 +537,7 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
             OpenVideoCodec( p_dec );
     }
 
-    p_block = *pp_block;
+    p_block = pp_block ? *pp_block : NULL;
     if(!p_block && !(p_sys->p_codec->capabilities & CODEC_CAP_DELAY) )
         return NULL;
 



More information about the vlc-commits mailing list