Commit 8a810ccb authored by Aurelien Jacobs's avatar Aurelien Jacobs

use return value of ff_get_line()

Originally committed as revision 24402 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent b0335fd9
...@@ -74,7 +74,7 @@ static int event_cmp(uint8_t **a, uint8_t **b) ...@@ -74,7 +74,7 @@ static int event_cmp(uint8_t **a, uint8_t **b)
static int read_header(AVFormatContext *s, AVFormatParameters *ap) static int read_header(AVFormatContext *s, AVFormatParameters *ap)
{ {
int i, header_remaining; int i, len, header_remaining;
ASSContext *ass = s->priv_data; ASSContext *ass = s->priv_data;
ByteIOContext *pb = s->pb; ByteIOContext *pb = s->pb;
AVStream *st; AVStream *st;
...@@ -95,7 +95,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -95,7 +95,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
while(!url_feof(pb)){ while(!url_feof(pb)){
uint8_t line[MAX_LINESIZE]; uint8_t line[MAX_LINESIZE];
ff_get_line(pb, line, sizeof(line)); len = ff_get_line(pb, line, sizeof(line));
if(!memcmp(line, "[Events]", 8)) if(!memcmp(line, "[Events]", 8))
header_remaining= 2; header_remaining= 2;
...@@ -111,8 +111,8 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -111,8 +111,8 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
if(!p) if(!p)
goto fail; goto fail;
*(dst[i])= p; *(dst[i])= p;
memcpy(p + pos[i], line, strlen(line)+1); memcpy(p + pos[i], line, len+1);
pos[i] += strlen(line); pos[i] += len;
if(i) ass->event_count++; if(i) ass->event_count++;
else header_remaining--; else header_remaining--;
} }
......
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