diff mbox series

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

Message ID 20200720104609.556543-1-zane@zanevaniperen.com
State Accepted
Commit 8598fc4010dc49ffdb360a844c4f60dc7d8cef15
Headers show
Series [FFmpeg-devel] avcodec/apm: fix sample_rate check | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Zane van Iperen July 20, 2020, 10:46 a.m. UTC
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
---
 libavformat/apm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Zane van Iperen July 20, 2020, 2:44 p.m. UTC | #1
On Mon, 20 Jul 2020 10:46:29 +0000
"Zane van Iperen" <zane@zanevaniperen.com> wrote:

> 
> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
> ---
>  libavformat/apm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
This is a trivial fix, will apply tomorrow if no objections.
diff mbox series

Patch

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)