• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/intel-driver


Commit MetaInfo

Révision1f2e87864a7e59c77fa25c912e8af2ea35177c11 (tree)
l'heure2015-09-15 11:03:10
AuteurXiang, Haihao <haihao.xiang@inte...>
CommiterXiang, Haihao

Message de Log

Check pointer against NULL first before dereferencing it

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Reviewed-by: Zhao, Yakui <yakui.zhao@intel.com>

Change Summary

Modification

--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -6348,20 +6348,20 @@ i965_Terminate(VADriverContextP ctx)
63486348 struct i965_driver_data *i965 = i965_driver_data(ctx);
63496349 int i;
63506350
6351- if (i965->wrapper_pdrvctx) {
6352- VADriverContextP pdrvctx;
6353- pdrvctx = i965->wrapper_pdrvctx;
6354- if (pdrvctx->handle) {
6355- pdrvctx->vtable->vaTerminate(pdrvctx);
6356- dlclose(pdrvctx->handle);
6357- pdrvctx->handle = NULL;
6358- }
6359- free(pdrvctx->vtable);
6360- free(pdrvctx);
6361- i965->wrapper_pdrvctx = NULL;
6362- }
6363-
63646351 if (i965) {
6352+ if (i965->wrapper_pdrvctx) {
6353+ VADriverContextP pdrvctx;
6354+ pdrvctx = i965->wrapper_pdrvctx;
6355+ if (pdrvctx->handle) {
6356+ pdrvctx->vtable->vaTerminate(pdrvctx);
6357+ dlclose(pdrvctx->handle);
6358+ pdrvctx->handle = NULL;
6359+ }
6360+ free(pdrvctx->vtable);
6361+ free(pdrvctx);
6362+ i965->wrapper_pdrvctx = NULL;
6363+ }
6364+
63656365 for (i = ARRAY_ELEMS(i965_sub_ops); i > 0; i--)
63666366 if (i965_sub_ops[i - 1].display_type == 0 ||
63676367 i965_sub_ops[i - 1].display_type == (ctx->display_type & VA_DISPLAY_MAJOR_MASK)) {