if aurgment is null, don't set data in get plane data 10/58710/2
authorChangyeon Lee <cyeon.lee@samsung.com>
Wed, 3 Feb 2016 05:05:15 +0000 (14:05 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 4 Feb 2016 01:18:16 +0000 (17:18 -0800)
Change-Id: Id5c212699f3fee88d058fe208c1f86bbac6674da
Signed-off-by: Changyeon Lee <cyeon.lee@samsung.com>
src/tbm_surface_internal.c

index 14b2598..bc59750 100644 (file)
@@ -792,9 +792,14 @@ int tbm_surface_internal_get_plane_data(tbm_surface_h surface, int plane_idx, ui
                return 0;
        }
 
-       *size = surf->info.planes[plane_idx].size;
-       *offset = surf->info.planes[plane_idx].offset;
-       *pitch = surf->info.planes[plane_idx].stride;
+       if (size)
+               *size = surf->info.planes[plane_idx].size;
+
+       if (offset)
+               *offset = surf->info.planes[plane_idx].offset;
+
+       if (pitch)
+               *pitch = surf->info.planes[plane_idx].stride;
 
        _tbm_surface_mutex_unlock();