]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/samidec.c
avdevice/avdevice: Constify av_*_device_next API
[ffmpeg] / libavformat / samidec.c
index 3070ef9bacf5e8fe404cb29beb5e506a2449a4be..d84f56ce6fae99546a489e61518ae959d934fe25 100644 (file)
@@ -89,12 +89,19 @@ static int sami_read_header(AVFormatContext *s)
             sub = ff_subtitles_queue_insert(&sami->q, buf.str, buf.len, !is_sync);
             if (!sub) {
                 res = AVERROR(ENOMEM);
+                av_bprint_finalize(&hdr_buf, NULL);
                 goto end;
             }
             if (is_sync) {
                 const char *p = ff_smil_get_attr_ptr(buf.str, "Start");
                 sub->pos      = pos;
                 sub->pts      = p ? strtol(p, NULL, 10) : 0;
+                if (sub->pts <= INT64_MIN/2 || sub->pts >= INT64_MAX/2) {
+                    res = AVERROR_PATCHWELCOME;
+                    av_bprint_finalize(&hdr_buf, NULL);
+                    goto end;
+                }
+
                 sub->duration = -1;
             }
         }