aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-05-11 00:00:52 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-23 13:15:16 +0200
commit3079f85dfb9188a0964c1a84c28d2658e1b497c2 (patch)
treeb23f3177c7389432a8d98916f69e2fa67a16b6a3
parent2bb39e8af830d1f8b9473752e67c0e6aed358411 (diff)
downloadffmpeg-3079f85dfb9188a0964c1a84c28d2658e1b497c2.tar.gz
avformat/utils: Check bps before using it in a shift in ff_get_pcm_codec_id()
Fixes undefined shift Fixes: usan_shift Found-by: Thomas Guilbert <tguilbert@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit ea791c080dd5494b3bee0c618a3f52e371b5f320) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index cf4d0d6f7d..28227ff3d1 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2650,6 +2650,9 @@ enum AVCodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags)
{
+ if (bps > 64U)
+ return AV_CODEC_ID_NONE;
+
if (flt) {
switch (bps) {
case 32: