Commit 50ed0055 authored by Antoine Cellerier's avatar Antoine Cellerier

Prevent segfault under windows. We now have to fix the stream_Size function so it works.

(exemple segfault with : $ ./vlc --fake-file="C:\Documents and Settings\Antoine\Mes documents\Mes images\vlc-1337.jpg" fake: )
parent 94b56e80
......@@ -209,6 +209,7 @@ static picture_t *ImageReadUrl( image_handler_t *p_image, const char *psz_url,
int i_size;
p_stream = stream_UrlNew( p_image->p_parent, psz_url );
if( !p_stream )
{
msg_Dbg( p_image->p_parent, "could not open %s for reading",
......@@ -220,6 +221,13 @@ static picture_t *ImageReadUrl( image_handler_t *p_image, const char *psz_url,
p_block = block_New( p_image->p_parent, i_size );
if( !p_block )
{
msg_Dbg( p_image->p_parent, "error while allocating memory to read %s",
psz_url );
return NULL;
}
stream_Read( p_stream, p_block->p_buffer, i_size );
stream_Delete( p_stream );
......
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