aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorChris Cunningham <chcunningham@chromium.org>2016-05-17 11:28:32 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2016-08-15 18:54:34 +0200
commitc1c6cb21b7d2e9bc82142ff0906fabef835b12ad (patch)
tree9d0b88b65779aef43af1635e7a5bf9d57fffe612 /libavformat/utils.c
parent2e0af764b32f76859d6b441812e2e2c9b5c1bed3 (diff)
downloadffmpeg-c1c6cb21b7d2e9bc82142ff0906fabef835b12ad.tar.gz
avformat/utils: Check negative bps before shifting in ff_get_pcm_codec_id()
Fixes: undefined shift. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 2875745d354ab0ebc4af1ebaca5c5a8d26ccdc03) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index d638ace640..930b235432 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2785,7 +2785,7 @@ 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)
+ if (bps <= 0 || bps > 64)
return AV_CODEC_ID_NONE;
if (flt) {