[vlc-commits] vlc_block_helper: fix null deref (cid #1400161)

Francois Cartegnie git at videolan.org
Thu Feb 9 23:13:09 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Feb  9 23:12:04 2017 +0100| [21601de5390a8fa959f7098e1aacfb57f6acdbca] | committer: Francois Cartegnie

vlc_block_helper: fix null deref (cid #1400161)

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

 include/vlc_block_helper.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/vlc_block_helper.h b/include/vlc_block_helper.h
index b94b461..d4e9a4b 100644
--- a/include/vlc_block_helper.h
+++ b/include/vlc_block_helper.h
@@ -138,7 +138,8 @@ static inline block_t *block_BytestreamPop( block_bytestream_t *p_bytestream )
     p_block = p_block->p_next;
     p_block_old->p_next = NULL;
     p_bytestream->pp_last = &p_block_old->p_next;
-    p_bytestream->i_total -= p_block->i_buffer;
+    if( p_block )
+        p_bytestream->i_total -= p_block->i_buffer;
 
     return p_block;
 }



More information about the vlc-commits mailing list