diff options
author | Chris Cunningham <chcunningham@chromium.org> | 2016-05-17 11:28:32 -0700 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-08-23 13:15:16 +0200 |
commit | 695dc70aeb97fec00cff87f472f9dfb3c3a1d15f (patch) | |
tree | 002bc5436f32685fb51a145f9a58673e671ef90b /libavformat/utils.c | |
parent | 6d560d4a0b8d57ab4e7ac2cee183d7a1bfa67428 (diff) | |
download | ffmpeg-695dc70aeb97fec00cff87f472f9dfb3c3a1d15f.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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 9d996fed4e..78caf79275 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2650,7 +2650,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) { |