OSDN Git Service

Fix potential uninitialized read
[android-x86/external-minigbm.git] / helpers.c
index c67787f..592981d 100644 (file)
--- a/helpers.c
+++ b/helpers.c
@@ -55,13 +55,6 @@ static const struct planar_layout packed_4bpp_layout = {
        .bytes_per_pixel = { 4 }
 };
 
-static const struct planar_layout packed_8bpp_layout = {
-       .num_planes = 1,
-       .horizontal_subsampling = { 1 },
-       .vertical_subsampling = { 1 },
-       .bytes_per_pixel = { 8 }
-};
-
 static const struct planar_layout biplanar_yuv_420_layout = {
        .num_planes = 2,
        .horizontal_subsampling = { 1, 2 },
@@ -144,9 +137,6 @@ static const struct planar_layout *layout_from_format(uint32_t format)
        case DRM_FORMAT_XRGB8888:
                return &packed_4bpp_layout;
 
-       case DRM_FORMAT_XBGR16161616:
-               return &packed_8bpp_layout;
-
        default:
                drv_log("UNKNOWN FORMAT %d\n", format);
                return NULL;
@@ -530,7 +520,8 @@ void drv_modify_combination(struct driver *drv, uint32_t format, struct format_m
 struct drv_array *drv_query_kms(struct driver *drv)
 {
        struct drv_array *kms_items;
-       uint64_t plane_type, use_flag;
+       uint64_t plane_type = UINT64_MAX;
+        uint64_t use_flag;
        uint32_t i, j, k;
 
        drmModePlanePtr plane;