]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/3dostr.c
avformat/dashenc: Remove deprecated min_seg_duration option
[ffmpeg] / libavformat / 3dostr.c
index 2d92b46570c747ffec8340039e125436bfc9ea11..534f205fc46bb0edc6596f3f9aa5291364a8de41 100644 (file)
@@ -29,10 +29,9 @@ static int threedostr_probe(const AVProbeData *p)
         unsigned chunk = AV_RL32(p->buf + i);
         unsigned size  = AV_RB32(p->buf + i + 4);
 
-        i += 8;
         if (size < 8 || p->buf_size - i < size)
             return 0;
-
+        i += 8;
         size -= 8;
         switch (chunk) {
         case MKTAG('C','T','R','L'):
@@ -104,7 +103,7 @@ static int threedostr_read_header(AVFormatContext *s)
             st->codecpar->codec_type  = AVMEDIA_TYPE_AUDIO;
             st->codecpar->sample_rate = avio_rb32(s->pb);
             st->codecpar->channels    = avio_rb32(s->pb);
-            if (st->codecpar->channels <= 0)
+            if (st->codecpar->channels <= 0 || st->codecpar->sample_rate <= 0)
                 return AVERROR_INVALIDDATA;
             codec                  = avio_rl32(s->pb);
             avio_skip(s->pb, 4);