[x265] [PATCH] param: Add validation check for invalid colorspace to prevent crash

Steve Borho steve at borho.org
Mon Mar 3 21:27:46 CET 2014


On Mon, Mar 3, 2014 at 5:19 AM,  <sagar at multicorewareinc.com> wrote:
> # HG changeset patch
> # User Sagar Kotecha <sagar at multicorewareinc.com>
> # Date 1393845552 -19800
> #      Mon Mar 03 16:49:12 2014 +0530
> # Node ID 631d6db7f96980aa032301a2cafa21177cc524a2
> # Parent  288a83d7e28999798859eba6b2f38c952cac7547
> param: Add validation check for invalid colorspace to prevent crash
>
> diff -r 288a83d7e289 -r 631d6db7f969 source/common/param.cpp
> --- a/source/common/param.cpp   Sun Mar 02 18:57:46 2014 -0600
> +++ b/source/common/param.cpp   Mon Mar 03 16:49:12 2014 +0530
> @@ -557,7 +557,12 @@
>          p->rc.qp = atoi(value);
>          p->rc.rateControlMode = X265_RC_CQP;
>      }
> -    OPT("input-csp") p->internalCsp = parseName(value, x265_source_csp_names, bError);
> +    OPT("input-csp")
> +    {
> +       p->internalCsp = parseName(value, x265_source_csp_names, bError);

> +       if(p->internalCsp < X265_CSP_I420 || p->internalCsp > X265_CSP_I444)

white-space

> +           bError |= true;

why do this range check here? x265_check_params() is already
validating that the color space is one of the two that are currently
supported.

> +    }
>      OPT("me")        p->searchMethod = parseName(value, x265_motion_est_names, bError);
>      OPT("cutree")    p->rc.cuTree = atobool(value);
>      OPT("vui")
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel



-- 
Steve Borho


More information about the x265-devel mailing list