diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-14 01:35:08 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-14 03:02:28 +0100 |
commit | 63465f00707c0dc6b1f0c30c950f5782dc9f059a (patch) | |
tree | 17c29e22fe7d2518f1f769ec03db7c7c001f5df9 | |
parent | 3300005351e7153caa4e59f960bb2b9a18f877b3 (diff) | |
download | ffmpeg-63465f00707c0dc6b1f0c30c950f5782dc9f059a.tar.gz |
avcodec/utils: Better check for channels in av_get_audio_frame_duration()
Fixes integer overflow
Fixes: 0c2625f236ced104d402b4a03c0d65c7/asan_generic_274e1ce_5990_9314e7a67c26aecf011b178ade9f217c.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4e16ad2868a1819de6680fc355a8eb20164adaea)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 6596aeae2b..cc689d8aaf 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -3418,7 +3418,7 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes) return frame_bytes * 8 / bps; } - if (ch > 0) { + if (ch > 0 && ch < INT_MAX/16) { /* calc from frame_bytes and channels */ switch (id) { case AV_CODEC_ID_ADPCM_AFC: |