aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-10-31 00:02:04 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-09 22:19:40 +0200
commit078bbcde0ea2fdae8c347ef2f30717eee7210237 (patch)
treec6fa24ba3363cfa6284601a22a3f4d48ebcb521e
parentd5cb859665d62658d7859f345650fcb38528c4ab (diff)
downloadffmpeg-078bbcde0ea2fdae8c347ef2f30717eee7210237.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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 6e14df0328..8d66cda701 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -121,6 +121,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;