Commit 2f04d372 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Fixed segmentation fault in input_SplitBuffer() when input_FillBuffer() could...

Fixed segmentation fault in input_SplitBuffer() when input_FillBuffer() could not allocate (actually input_NewBuffer()) another buffer. The code tested for:
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!
parent 2e6a0471
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_ext-plugins.c: useful functions for access and demux plug-ins * input_ext-plugins.c: useful functions for access and demux plug-ins
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * 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> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -593,7 +593,7 @@ ssize_t input_SplitBuffer( input_thread_t * p_input, ...@@ -593,7 +593,7 @@ ssize_t input_SplitBuffer( input_thread_t * p_input,
} }
} }
if ( !i_size ) if ( i_size < 0)
{ {
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment