[FFmpeg-cvslog] r24402 - trunk/libavformat/assdec.c

aurel subversion
Wed Jul 21 23:41:46 CEST 2010


Author: aurel
Date: Wed Jul 21 23:41:46 2010
New Revision: 24402

Log:
use return value of ff_get_line()

Modified:
   trunk/libavformat/assdec.c

Modified: trunk/libavformat/assdec.c
==============================================================================
--- trunk/libavformat/assdec.c	Wed Jul 21 23:40:50 2010	(r24401)
+++ trunk/libavformat/assdec.c	Wed Jul 21 23:41:46 2010	(r24402)
@@ -74,7 +74,7 @@ static int event_cmp(uint8_t **a, uint8_
 
 static int read_header(AVFormatContext *s, AVFormatParameters *ap)
 {
-    int i, header_remaining;
+    int i, len, header_remaining;
     ASSContext *ass = s->priv_data;
     ByteIOContext *pb = s->pb;
     AVStream *st;
@@ -95,7 +95,7 @@ static int read_header(AVFormatContext *
     while(!url_feof(pb)){
         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))
             header_remaining= 2;
@@ -111,8 +111,8 @@ static int read_header(AVFormatContext *
         if(!p)
             goto fail;
         *(dst[i])= p;
-        memcpy(p + pos[i], line, strlen(line)+1);
-        pos[i] += strlen(line);
+        memcpy(p + pos[i], line, len+1);
+        pos[i] += len;
         if(i) ass->event_count++;
         else  header_remaining--;
     }



More information about the ffmpeg-cvslog mailing list