[vlc-commits] stats: add missing error check

Thomas Guillem git at videolan.org
Mon Sep 26 17:13:32 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Sep 26 16:30:19 2016 +0200| [2c4bec7c55fc38f8c064789b7a33772b882a90f1] | committer: Thomas Guillem

stats: add missing error check

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

 modules/misc/stats.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/misc/stats.c b/modules/misc/stats.c
index cced390..61530d1 100644
--- a/modules/misc/stats.c
+++ b/modules/misc/stats.c
@@ -49,6 +49,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
     p_block = *pp_block;
 
     p_pic = decoder_NewPicture( p_dec );
+    if( !p_pic )
+        goto error;
 
     if( p_block->i_buffer == kBufferSize )
     {
@@ -68,6 +70,7 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
             p_block->i_pts : p_block->i_dts;
     p_pic->b_force = true;
 
+error:
     block_Release( p_block );
     *pp_block = NULL;
     return p_pic;



More information about the vlc-commits mailing list