hardware/intel/common/vaapi
Révision | d3d961aa2a8ed3ac092cd5994378ae5ff9248fe4 (tree) |
---|---|
l'heure | 2017-08-11 09:08:36 |
Auteur | U. Artie Eoff <ullysses.a.eoff@inte...> |
Commiter | Xiang, Haihao |
avoid NULL pointer deref in i965_CreateConfig
The attrib_found pointer variable might be NULL in many cases.
Thus, check it before attempting to dereference it.
Fixes #246
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
@@ -1305,10 +1305,10 @@ i965_CreateConfig(VADriverContextP ctx, | ||
1305 | 1305 | case VAProfileH264ConstrainedBaseline: |
1306 | 1306 | case VAProfileH264Main: |
1307 | 1307 | case VAProfileH264High: |
1308 | - if ((entrypoint == VAEntrypointEncSlice) && | |
1308 | + if ((entrypoint == VAEntrypointEncSlice) && attrib_found && | |
1309 | 1309 | !(attrib_found->value & i965->codec_info->h264_brc_mode)) |
1310 | 1310 | vaStatus = VA_STATUS_ERROR_INVALID_CONFIG; |
1311 | - else if ((entrypoint == VAEntrypointEncSliceLP) && | |
1311 | + else if ((entrypoint == VAEntrypointEncSliceLP) && attrib_found && | |
1312 | 1312 | !(attrib_found->value & i965->codec_info->lp_h264_brc_mode)) |
1313 | 1313 | vaStatus = VA_STATUS_ERROR_INVALID_CONFIG; |
1314 | 1314 | break; |