[vlc-commits] libmp4: fix segfault
Francois Cartegnie
git at videolan.org
Sat Nov 1 15:56:39 CET 2014
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Oct 29 15:38:09 2014 +0000| [c70140142089ffd7512bbe9addc6e7f09a732da8] | committer: Jean-Baptiste Kempf
libmp4: fix segfault
Le 28/10/2014 23:11, Frédéric Yhuel a écrit :
> static int MP4_NextBox( stream_t *p_stream, MP4_Box_t *p_box )
> {
> - MP4_Box_t box;
> + MP4_Box_t box = {0};
>
> if( !p_box )
> {
>
Better fail early. (untested, no sample)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c70140142089ffd7512bbe9addc6e7f09a732da8
---
modules/demux/mp4/libmp4.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 5f02754..9cc62ef 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -150,7 +150,8 @@ static int MP4_NextBox( stream_t *p_stream, MP4_Box_t *p_box )
if( !p_box )
{
- MP4_ReadBoxCommon( p_stream, &box );
+ if ( !MP4_ReadBoxCommon( p_stream, &box ) )
+ return 0;
p_box = &box;
}
More information about the vlc-commits
mailing list