]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/nistspheredec.c
fftools/cmdutils: also print warnings when using -sinks and -sources
[ffmpeg] / libavformat / nistspheredec.c
index 55f22ebcf4f0ea052167e6ccd6c0e16ea0bb5b00..079369929f096d115957e0942fa4d12b86f6e3ba 100644 (file)
@@ -25,7 +25,7 @@
 #include "internal.h"
 #include "pcm.h"
 
-static int nist_probe(AVProbeData *p)
+static int nist_probe(const AVProbeData *p)
 {
     if (AV_RL64(p->buf) == AV_RL64("NIST_1A\x0a"))
         return AVPROBE_SCORE_MAX;
@@ -109,6 +109,8 @@ static int nist_read_header(AVFormatContext *s)
             sscanf(buffer, "%*s %*s %"SCNd64, &st->duration);
         } else if (!memcmp(buffer, "sample_n_bytes", 14)) {
             sscanf(buffer, "%*s %*s %d", &bps);
+            if (bps > INT_MAX/8U)
+                return AVERROR_INVALIDDATA;
         } else if (!memcmp(buffer, "sample_rate", 11)) {
             sscanf(buffer, "%*s %*s %d", &st->codecpar->sample_rate);
         } else if (!memcmp(buffer, "sample_sig_bits", 15)) {