diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2015-07-08 10:12:51 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2015-07-08 10:48:04 +0200 |
commit | a8973b8b9111238ec1b3db3509ea9ee072fa090e (patch) | |
tree | 10adad49fce0c38f328ab23244e0ccbb856f8589 | |
parent | 4adc23ad9ab0c23d45203f75117650ad356261ee (diff) | |
download | android_hardware_samsung_slsi_exynos5430-a8973b8b9111238ec1b3db3509ea9ee072fa090e.tar.gz android_hardware_samsung_slsi_exynos5430-a8973b8b9111238ec1b3db3509ea9ee072fa090e.tar.xz android_hardware_samsung_slsi_exynos5430-a8973b8b9111238ec1b3db3509ea9ee072fa090e.zip |
gralloc: Make sure several variables are not used uninitialized
-rw-r--r-- | gralloc/gralloc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gralloc/gralloc.cpp b/gralloc/gralloc.cpp index a929306..afa8cae 100644 --- a/gralloc/gralloc.cpp +++ b/gralloc/gralloc.cpp @@ -130,8 +130,8 @@ static unsigned int _select_heap(int usage) static int gralloc_alloc_rgb(int ionfd, int w, int h, int format, int usage, unsigned int ion_flags, private_handle_t **hnd, int *stride) { - size_t size, bpr, alignment = 0, ext_size=256; - int bpp = 0, vstride, fd, err; + size_t size = w * h, bpr, alignment = 0, ext_size=256; + int bpp = 0, vstride = h, fd = -1, err; unsigned int heap_mask = _select_heap(usage); if (format == HAL_PIXEL_FORMAT_RGBA_8888) { @@ -358,7 +358,7 @@ static int gralloc_alloc(alloc_device_t* dev, int w, int h, int format, int usage, buffer_handle_t* pHandle, int* pStride) { - int stride; + int stride = w; int err; unsigned int ion_flags = 0; private_handle_t *hnd = NULL; |