[FFmpeg-devel] [PATCH] avformat/utils: Check negative bps before shifting in ff_get_pcm_codec_id()
Chris Cunningham
chcunningham at chromium.org
Tue May 17 20:30:05 CEST 2016
New patch drops the U. Hendrik, you'r right about the negative, but you're
also right about the 0. 0 is a case of undefined shift behavior (shift
becomes -1).
On Tue, May 17, 2016 at 11:28 AM, <chcunningham at chromium.org> wrote:
> From: Chris Cunningham <chcunningham at chromium.org>
>
> Fixes: undefined shift.
> ---
> libavformat/utils.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 5f5f03e..d1e4306 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -2955,7 +2955,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) {
> --
> 2.8.0.rc3.226.g39d4020
>
>
More information about the ffmpeg-devel
mailing list