OSDN Git Service

Fix potential uninitialized read am: 6acf248c84 am: 1c4a1cf7e4
[android-x86/external-minigbm.git] / helpers.c
index eaaa937..592981d 100644 (file)
--- a/helpers.c
+++ b/helpers.c
@@ -183,8 +183,7 @@ uint32_t drv_stride_from_format(uint32_t format, uint32_t width, size_t plane)
        const struct planar_layout *layout = layout_from_format(format);
        assert(plane < layout->num_planes);
 
-       uint32_t plane_width =
-               DIV_ROUND_UP(width, layout->horizontal_subsampling[plane]);
+       uint32_t plane_width = DIV_ROUND_UP(width, layout->horizontal_subsampling[plane]);
        uint32_t stride = plane_width * layout->bytes_per_pixel[plane];
 
        /*
@@ -521,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;