]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/subviewerdec.c
avformat: Constify all muxer/demuxers
[ffmpeg] / libavformat / subviewerdec.c
index fdca3a48205dfecc453d9c9d4c65c376f5095b12..9bb7728407cfbe8664d9b7bc018ba846befdea84 100644 (file)
@@ -148,6 +148,10 @@ static int subviewer_read_header(AVFormatContext *s)
             new_event = 1;
             pos = avio_tell(s->pb);
         } else if (*line) {
+            if (pts_start == AV_NOPTS_VALUE) {
+                res = AVERROR_INVALIDDATA;
+                goto end;
+            }
             if (!new_event) {
                 sub = ff_subtitles_queue_insert(&subviewer->q, "\n", 1, 1);
                 if (!sub) {
@@ -199,7 +203,7 @@ static int subviewer_read_close(AVFormatContext *s)
     return 0;
 }
 
-AVInputFormat ff_subviewer_demuxer = {
+const AVInputFormat ff_subviewer_demuxer = {
     .name           = "subviewer",
     .long_name      = NULL_IF_CONFIG_SMALL("SubViewer subtitle format"),
     .priv_data_size = sizeof(SubViewerContext),