]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/apm: fix sample_rate check
authorZane van Iperen <zane@zanevaniperen.com>
Mon, 20 Jul 2020 03:35:26 +0000 (13:35 +1000)
committerZane van Iperen <zane@zanevaniperen.com>
Tue, 21 Jul 2020 01:33:00 +0000 (11:33 +1000)
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
libavformat/apm.c

index 0d88e1099abc12377fbe926251796de72ffd4163..fe95a9ad7abdcc961791991386db08d61cba120e 100644 (file)
@@ -126,8 +126,8 @@ static int apm_read_header(AVFormatContext *s)
     if (avio_rl32(s->pb) != APM_FILE_EXTRADATA_SIZE)
         return AVERROR_INVALIDDATA;
 
-    /* I've never seen files greater than this. */
-    if (par->sample_rate > 44100)
+    /* 8 = bits per sample * max channels */
+    if (par->sample_rate > (INT_MAX / 8))
         return AVERROR_INVALIDDATA;
 
     if (par->bits_per_coded_sample != 4)