From: Laurent Aimar Date: Mon, 13 Apr 2009 19:24:05 +0000 (+0200) Subject: Fixed an incorrect read() error handling (http access). X-Git-Tag: 1.0.0-pre2~74 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=fb79b01e7bcea0876b2e62da67e9ca12b5458349;p=vlc Fixed an incorrect read() error handling (http access). It was based on xxcv investigation and preliminary patch. It should fix #2644. --- diff --git a/modules/access/http.c b/modules/access/http.c index 0304f2d503..e10114f9cb 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -750,7 +750,7 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len ) } } } - else if( i_read == 0 ) + else if( i_read <= 0 ) { /* * I very much doubt that this will work. @@ -781,7 +781,10 @@ static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len ) } } - if( i_read == 0 ) p_access->info.b_eof = true; + if( i_read == 0 ) + p_access->info.b_eof = true; + else if( i_read < 0 ) + p_access->b_error = true; } if( p_access->info.i_size != -1 )