diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-05-11 00:00:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-06-05 02:40:30 +0200 |
commit | 79181b97d477386e26bd1d4d476b33376f194c96 (patch) | |
tree | 25d1bf589e5256089d699ad620d3017d62727ff9 /libavformat/utils.c | |
parent | 46360e36d928d0856ce818adbec9d9545c4c5559 (diff) | |
download | ffmpeg-79181b97d477386e26bd1d4d476b33376f194c96.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>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 3aa5beb6b1..9fa744377c 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2833,6 +2833,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: |