[vlc-commits] demux: mp4: don't NULL dereference on failed realloc

Francois Cartegnie git at videolan.org
Tue Mar 17 16:58:49 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Mar 17 15:59:41 2015 +0100| [fc81c4e2b55c1367bbf67cb7a2b98bb63d4ca6d1] | committer: Francois Cartegnie

demux: mp4: don't NULL dereference on failed realloc

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

 modules/mux/mp4.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/mux/mp4.c b/modules/mux/mp4.c
index 10fd8ca..e507eb4 100644
--- a/modules/mux/mp4.c
+++ b/modules/mux/mp4.c
@@ -721,7 +721,8 @@ static int Mux(sout_mux_t *p_mux)
 static block_t *ConvertSUBT(block_t *p_block)
 {
     p_block = block_Realloc(p_block, 2, p_block->i_buffer);
-
+    if( !p_block )
+        return NULL;
     /* No trailling '\0' */
     if (p_block->i_buffer > 2 && p_block->p_buffer[p_block->i_buffer-1] == '\0')
         p_block->i_buffer--;
@@ -2836,6 +2837,9 @@ static int MuxFrag(sout_mux_t *p_mux)
         break;
     }
 
+    if( !p_currentblock )
+        return VLC_ENOMEM;
+
     /* If we have a previous entry for outgoing queue */
     if (p_stream->p_held_entry)
     {



More information about the vlc-commits mailing list