[FFmpeg-cvslog] avcodec/apm: fix sample_rate check

Zane van Iperen git at videolan.org
Tue Jul 21 04:34:26 EEST 2020


ffmpeg | branch: master | Zane van Iperen <zane at zanevaniperen.com> | Mon Jul 20 13:35:26 2020 +1000| [8598fc4010dc49ffdb360a844c4f60dc7d8cef15] | committer: Zane van Iperen

avcodec/apm: fix sample_rate check

Signed-off-by: Zane van Iperen <zane at zanevaniperen.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8598fc4010dc49ffdb360a844c4f60dc7d8cef15
---

 libavformat/apm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/apm.c b/libavformat/apm.c
index 0d88e1099a..fe95a9ad7a 100644
--- a/libavformat/apm.c
+++ b/libavformat/apm.c
@@ -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)



More information about the ffmpeg-cvslog mailing list