OSDN Git Service

FEI: validate VAConfigAttribRateControl in i965_CreateConfig
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Wed, 23 Aug 2017 16:14:17 +0000 (09:14 -0700)
committerXiang, Haihao <haihao.xiang@intel.com>
Thu, 24 Aug 2017 00:55:06 +0000 (08:55 +0800)
VAEntrypointFEI only supports VA_RC_CQP in VAConfigAttribRateControl
config attribute.  Return VA_STATUS_ERROR_INVALID_CONFIG if it's
set to anything else.

Fixes #257

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
src/i965_drv_video.c

index 122586f..713ce24 100644 (file)
@@ -1338,6 +1338,9 @@ i965_CreateConfig(VADriverContextP ctx,
             else if ((entrypoint == VAEntrypointEncSliceLP) && attrib_found &&
                      !(attrib_found->value & i965->codec_info->lp_h264_brc_mode))
                 vaStatus = VA_STATUS_ERROR_INVALID_CONFIG;
+            else if ((entrypoint == VAEntrypointFEI) && attrib_found &&
+                     !(attrib_found->value == VA_RC_CQP))
+                vaStatus = VA_STATUS_ERROR_INVALID_CONFIG;
             break;
         default:
             break;