]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/samidec.c
lavf/sga: Silence several warnings because of wrong format specifiers.
[ffmpeg] / libavformat / samidec.c
index fd98393086bf810190073ff63fd1bbe467f53d99..cf5076c7b817145483ea3e0776be56ef030f7bd4 100644 (file)
@@ -95,6 +95,11 @@ static int sami_read_header(AVFormatContext *s)
                 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;
+                    goto end;
+                }
+
                 sub->duration = -1;
             }
         }
@@ -108,6 +113,8 @@ static int sami_read_header(AVFormatContext *s)
     ff_subtitles_queue_finalize(s, &sami->q);
 
 end:
+    if (res < 0)
+        ff_subtitles_queue_clean(&sami->q);
     av_bprint_finalize(&buf, NULL);
     return res;
 }