[FFmpeg-devel] [PATCH 1/3] avformat/aiffdec: Check sample_rate
Michael Niedermayer
michael at niedermayer.cc
Sun Oct 31 01:30:51 EEST 2021
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavformat/aiffdec.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index a826bc998ad..14063474260 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;
--
2.17.1
More information about the ffmpeg-devel
mailing list