• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

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

Revision19cf264f30919b872dd8d4517ab9cdbf1057860d (tree)
Zeit2015-09-06 16:13:57
AutorXu Guangxin <Guangxin.Xu@inte...>
CommiterXiang, Haihao

Log Message

CreateSurfaces2: forward function return to caller

we did not check following function's return:
i965_surface_native_memory
i965_suface_external_memory
i965_check_alloc_surface_bo
It will be in trouble if underlay buffer allocation is failed.
(cherry picked from commit 12b3d9ef379e6159e30c2aafc040f1137cd4141a)

Ändern Zusammenfassung

Diff

--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -989,9 +989,7 @@ i965_surface_native_memory(VADriverContextP ctx,
989989 expected_fourcc == VA_FOURCC_YV16)
990990 tiling = 0;
991991
992- i965_check_alloc_surface_bo(ctx, obj_surface, tiling, expected_fourcc, get_sampling_from_fourcc(expected_fourcc));
993-
994- return VA_STATUS_SUCCESS;
992+ return i965_check_alloc_surface_bo(ctx, obj_surface, tiling, expected_fourcc, get_sampling_from_fourcc(expected_fourcc));
995993 }
996994
997995 static VAStatus
@@ -1327,19 +1325,23 @@ i965_CreateSurfaces2(
13271325 }
13281326 }
13291327 }
1330- i965_surface_native_memory(ctx,
1331- obj_surface,
1332- format,
1333- expected_fourcc);
1328+ vaStatus = i965_surface_native_memory(ctx,
1329+ obj_surface,
1330+ format,
1331+ expected_fourcc);
13341332 break;
13351333
13361334 case I965_SURFACE_MEM_GEM_FLINK:
13371335 case I965_SURFACE_MEM_DRM_PRIME:
1338- i965_suface_external_memory(ctx,
1339- obj_surface,
1340- memory_type,
1341- memory_attibute,
1342- i);
1336+ vaStatus = i965_suface_external_memory(ctx,
1337+ obj_surface,
1338+ memory_type,
1339+ memory_attibute,
1340+ i);
1341+ break;
1342+ }
1343+ if (VA_STATUS_SUCCESS != vaStatus) {
1344+ i965_destroy_surface(&i965->surface_heap, (struct object_base *)obj_surface);
13431345 break;
13441346 }
13451347 }