]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/webvttdec.c
avutil/buffer: Switch AVBuffer API to size_t
[ffmpeg] / libavformat / webvttdec.c
index 6c4d5f6736e12eb3da3ec5d89ed1bbd8dd58185e..cf060bd01180066863cad582eaa4eec8d19d4943 100644 (file)
@@ -78,7 +78,7 @@ static int webvtt_read_header(AVFormatContext *s)
         int64_t pos;
         AVPacket *sub;
         const char *p, *identifier, *settings;
-        int identifier_len, settings_len;
+        size_t identifier_len, settings_len;
         int64_t ts_start, ts_end;
 
         ff_subtitles_read_chunk(s->pb, &cue);
@@ -125,7 +125,7 @@ static int webvtt_read_header(AVFormatContext *s)
             break;
 
         /* optional cue settings */
-        p += strcspn(p, "\n\t ");
+        p += strcspn(p, "\n\r\t ");
         while (*p == '\t' || *p == ' ')
             p++;
         settings = p;
@@ -164,6 +164,8 @@ static int webvtt_read_header(AVFormatContext *s)
     ff_subtitles_queue_finalize(s, &webvtt->q);
 
 end:
+    if (res < 0)
+        ff_subtitles_queue_clean(&webvtt->q);
     av_bprint_finalize(&cue,    NULL);
     return res;
 }