diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-31 00:02:04 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-12-01 22:02:17 +0100 |
commit | 2d2ed8b045bc90fd3c87309bcdf358f2d0fc84cb (patch) | |
tree | 13ec21142c564120ede9d8bb515dcf9a8137f07d | |
parent | f8b4426c10aa65f4c04847a50ebfdcb8782a49b7 (diff) | |
download | ffmpeg-2d2ed8b045bc90fd3c87309bcdf358f2d0fc84cb.tar.gz |
avformat/aiffdec: Check sample_rate
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1b04836dff9958e8bfdbed2746b8c40b1e119ecc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/aiffdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index 2387d12723..3716de1621 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -122,6 +122,9 @@ static int get_aiff_header(AVFormatContext *s, int size, sample_rate = val << exp; else sample_rate = (val + (1ULL<<(-exp-1))) >> -exp; + if (sample_rate <= 0) + return AVERROR_INVALIDDATA; + par->sample_rate = sample_rate; if (size < 18) return AVERROR_INVALIDDATA; |