]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/realtextdec.c
avutil/opt: add AV_OPT_FLAG_CHILD_CONSTS
[ffmpeg] / libavformat / realtextdec.c
index e12871e6ad5255bf50d7d4dbcc61f90a7f527b97..c2316da0ed8d1878df8d85fae698cc8d7502edef 100644 (file)
@@ -87,6 +87,10 @@ static int realtext_read_header(AVFormatContext *s)
             /* save header to extradata */
             const char *p = ff_smil_get_attr_ptr(buf.str, "duration");
 
+            if (st->codecpar->extradata) {
+                res = AVERROR_INVALIDDATA;
+                goto end;
+            }
             if (p)
                 duration = read_ts(p);
             st->codecpar->extradata = av_strdup(buf.str);
@@ -119,6 +123,8 @@ static int realtext_read_header(AVFormatContext *s)
 
 end:
     av_bprint_finalize(&buf, NULL);
+    if (res < 0)
+        ff_subtitles_queue_clean(&rt->q);
     return res;
 }