[vlc-commits] demux: mp4: fix fwd null (cid #1408972)

Francois Cartegnie git at videolan.org
Sat May 20 13:55:21 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri May 19 10:58:20 2017 +0200| [29cfd497505788315c3dffbe59508bd4fd7cc50d] | committer: Francois Cartegnie

demux: mp4: fix fwd null (cid #1408972)

on failed alloc of 0 payload size

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

 modules/demux/mp4/mp4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index c77379b289..99c02ac50f 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -4248,7 +4248,7 @@ static int FragDemuxTrack( demux_t *p_demux, mp4_track_t *p_track,
         block_t *p_block = vlc_stream_Block( p_demux->s, len );
         uint32_t i_read = ( p_block ) ? p_block->i_buffer : 0;
         p_track->context.i_trun_sample_pos += i_read;
-        if( i_read < len )
+        if( i_read < len || p_block == NULL )
         {
             free( p_block );
             return VLC_DEMUXER_EOF;



More information about the vlc-commits mailing list