]> git.sesse.net Git - vlc/commitdiff
Fixed segmentation fault in input_SplitBuffer() when input_FillBuffer() could not...
authorJean-Paul Saman <jpsaman@videolan.org>
Wed, 13 Aug 2003 13:54:02 +0000 (13:54 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Wed, 13 Aug 2003 13:54:02 +0000 (13:54 +0000)
if (!i_size)
{
  /* Handle error */
}

However input_SplitBuffer() returns -1, which results in if (false) here and a segmentation fault will happen when input_ShareBuffer() is called. All constructs of the above form are supicious to produce a segfault in the code!

src/input/input_ext-plugins.c

index 2e897bda7a6b4ef40092a9dd370e38ef552100d9..123cc4c46c3647d1da85dce297af8c80f724b565 100644 (file)
@@ -2,7 +2,7 @@
  * input_ext-plugins.c: useful functions for access and demux plug-ins
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: input_ext-plugins.c,v 1.36 2003/08/03 20:25:04 gbazin Exp $
+ * $Id: input_ext-plugins.c,v 1.37 2003/08/13 13:54:02 jpsaman Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -593,7 +593,7 @@ ssize_t input_SplitBuffer( input_thread_t * p_input,
         }
     }
 
-    if ( !i_size )
+    if ( i_size < 0)
     {
         return 0;
     }