aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-10-31 00:02:04 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-11-01 20:37:20 +0100
commit1b04836dff9958e8bfdbed2746b8c40b1e119ecc (patch)
tree1d9a652e80e2f5295fe81320dd2966687ffc7701
parent28fac45bde9fd38599a9c2896b58573d8e7303ff (diff)
downloadffmpeg-1b04836dff9958e8bfdbed2746b8c40b1e119ecc.tar.gz
avformat/aiffdec: Check sample_rate
Reviewed-by: Paul B Mahol <onemda@gmail.com> 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 a826bc998a..1406347426 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -120,6 +120,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;