aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Cunningham <chcunningham@chromium.org>2016-05-17 11:28:32 -0700
committerMichael Niedermayer <michael@niedermayer.cc>2016-06-05 02:40:31 +0200
commit145b18ce9a27554fdb4af5f2c122b5f44bf521b3 (patch)
tree48cdb933f90c45529150407b2c4b29e1fa331145
parente5d167149d82a8ca3509a94a62989af5b24a943d (diff)
downloadandroid_external_ffmpeg-145b18ce9a27554fdb4af5f2c122b5f44bf521b3.tar.gz
android_external_ffmpeg-145b18ce9a27554fdb4af5f2c122b5f44bf521b3.tar.bz2
android_external_ffmpeg-145b18ce9a27554fdb4af5f2c122b5f44bf521b3.zip
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>
-rw-r--r--libavformat/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 054cada7f9..7ed21b6762 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2833,7 +2833,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) {