From: U. Artie Eoff Date: Thu, 10 Aug 2017 18:15:57 +0000 (-0700) Subject: avoid NULL pointer deref in i965_CreateConfig X-Git-Tag: android-x86-7.1-r1~2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d3d961aa2a8ed3ac092cd5994378ae5ff9248fe4;p=android-x86%2Fhardware-intel-common-vaapi.git 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 --- diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c index 7e87870..67d1186 100644 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -1305,10 +1305,10 @@ i965_CreateConfig(VADriverContextP ctx, case VAProfileH264ConstrainedBaseline: case VAProfileH264Main: case VAProfileH264High: - if ((entrypoint == VAEntrypointEncSlice) && + if ((entrypoint == VAEntrypointEncSlice) && attrib_found && !(attrib_found->value & i965->codec_info->h264_brc_mode)) vaStatus = VA_STATUS_ERROR_INVALID_CONFIG; - else if ((entrypoint == VAEntrypointEncSliceLP) && + else if ((entrypoint == VAEntrypointEncSliceLP) && attrib_found && !(attrib_found->value & i965->codec_info->lp_h264_brc_mode)) vaStatus = VA_STATUS_ERROR_INVALID_CONFIG; break;