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

sagar at multicorewareinc.com sagar at multicorewareinc.com
Mon Mar 3 12:19:21 CET 2014


# 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)
+           bError |= true;
+    }
     OPT("me")        p->searchMethod = parseName(value, x265_motion_est_names, bError);
     OPT("cutree")    p->rc.cuTree = atobool(value);
     OPT("vui")


More information about the x265-devel mailing list