[libav-devel] [PATCH] nuv: reject negative fps rate

Luca Barbato lu_zero at gentoo.org
Wed Dec 16 22:18:47 CET 2015


On 16/12/15 20:56, Andreas Cadhalpun wrote:
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavformat/nuv.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libavformat/nuv.c b/libavformat/nuv.c
> index 2a1b70f..4cb28d5 100644
> --- a/libavformat/nuv.c
> +++ b/libavformat/nuv.c
> @@ -172,6 +172,10 @@ static int nuv_header(AVFormatContext *s)
>      if (aspect > 0.9999 && aspect < 1.0001)
>          aspect = 4.0 / 3.0;
>      fps = av_int2double(avio_rl64(pb));
> +    if (fps <= 0.0f) {
> +        av_log(s, AV_LOG_ERROR, "Invalid frame rate %f\n", fps);
> +        return AVERROR_INVALIDDATA;
> +    }
>  
>      // number of packets per stream type, -1 means unknown, e.g. streaming
>      v_packs = avio_rl32(pb);
> 

What happens if a negative fps is used?


More information about the libav-devel mailing list