[FFmpeg-cvslog] avformat/utils: Check negative bps before shifting in ff_get_pcm_codec_id( )

Chris Cunningham git at videolan.org
Sun Jun 5 03:16:43 CEST 2016


ffmpeg | branch: release/3.0 | Chris Cunningham <chcunningham at chromium.org> | Tue May 17 11:28:32 2016 -0700| [145b18ce9a27554fdb4af5f2c122b5f44bf521b3] | committer: Michael Niedermayer

avformat/utils: Check negative bps before shifting in ff_get_pcm_codec_id()

Fixes: undefined shift.

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 2875745d354ab0ebc4af1ebaca5c5a8d26ccdc03)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=145b18ce9a27554fdb4af5f2c122b5f44bf521b3
---

 libavformat/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 054cada..7ed21b6 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) {



More information about the ffmpeg-cvslog mailing list