]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/adxdec.c
avformat/aadec: stop ignoring file metadata
[ffmpeg] / libavformat / adxdec.c
index cf4453195ecf628080fb097c4b39d4f33097f33b..a271e2afa80a7e8ca08878c5a373ac98ed7d220c 100644 (file)
@@ -109,9 +109,14 @@ static int adx_read_header(AVFormatContext *s)
         return AVERROR_INVALIDDATA;
     }
 
+    if (par->sample_rate <= 0) {
+        av_log(s, AV_LOG_ERROR, "Invalid sample rate %d\n", par->sample_rate);
+        return AVERROR_INVALIDDATA;
+    }
+
     par->codec_type  = AVMEDIA_TYPE_AUDIO;
     par->codec_id    = s->iformat->raw_codec_id;
-    par->bit_rate    = par->sample_rate * par->channels * BLOCK_SIZE * 8LL / BLOCK_SAMPLES;
+    par->bit_rate    = (int64_t)par->sample_rate * par->channels * BLOCK_SIZE * 8LL / BLOCK_SAMPLES;
 
     avpriv_set_pts_info(st, 64, BLOCK_SAMPLES, par->sample_rate);