]> git.sesse.net Git - vlc/blobdiff - modules/demux/asf/asf.c
* asf: prevent some segfault with broken file. (partially fix bug 72)
[vlc] / modules / demux / asf / asf.c
index 2c4c604df57657990268049041bb56351fc4e132..b2c314432ef852d2791c7c8388051b4639aba5c3 100644 (file)
@@ -2,7 +2,7 @@
  * asf.c : ASFv01 file input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: asf.c,v 1.14 2003/01/07 21:49:01 fenrir Exp $
+ * $Id: asf.c,v 1.15 2003/01/11 18:10:49 fenrir Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -566,6 +566,12 @@ static int Demux( input_thread_t *p_input )
             mtime_t i_pts;
             mtime_t i_pts_delta;
 
+            if( i_skip >= i_packet_size_left )
+            {
+                /* prevent some segfault with invalid file */
+                break;
+            }
+
             i_stream_number = p_peek[i_skip] & 0x7f;
             i_skip++;