]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/oggparsespeex.c
matroskadec: partly revert "demux relevant subtitle packets after a seek"
[ffmpeg] / libavformat / oggparsespeex.c
index 434b0fdab154656a1976d7cdfffd3d4d2e362879..2b4915087821d33794d5bc59a079620bd4f76d98 100644 (file)
@@ -68,6 +68,10 @@ static int speex_header(AVFormatContext *s, int idx) {
         }
 
         st->codecpar->sample_rate = AV_RL32(p + 36);
+        if (st->codecpar->sample_rate <= 0) {
+            av_log(s, AV_LOG_ERROR, "Invalid sample rate %d\n", st->codecpar->sample_rate);
+            return AVERROR_INVALIDDATA;
+        }
         st->codecpar->channels = AV_RL32(p + 48);
         if (st->codecpar->channels < 1 || st->codecpar->channels > 2) {
             av_log(s, AV_LOG_ERROR, "invalid channel count. Speex must be mono or stereo.\n");