Change parameter null checking condition of mm_display_set_display() 87/249087/2 accepted/tizen/unified/20201208.123149 submit/tizen/20201207.082754
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 7 Dec 2020 04:29:52 +0000 (13:29 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 7 Dec 2020 05:35:58 +0000 (14:35 +0900)
The parent_id as out-parameter has been only filled with MM_DISPLAY_TYPE_OVERLAY
or MM_DISPLAY_TYPE_OVERLAY_EXT type. Because the other types are not needed
the out-parameter, the condition of the parameter checking is revised.

[Version] 0.0.9
[Profile] Common
[Issue Type] Improvement

Change-Id: I8cfc043c0ac3aedc384924a8cac8d0b3b94dfbe8
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/libmm-display.spec
src/mm_display.c

index 40a157d..8603f88 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-display
 Summary:    Multimedia framework display library
-Version:    0.0.8
+Version:    0.0.9
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index c53477a..1a75bb7 100644 (file)
@@ -280,9 +280,12 @@ int mm_display_set_display(mm_display_h handle, mm_display_type_e type, void *di
        MMHandleType new_evas_renderer = NULL;
 #endif
 
-       if (!handle || !display || !parent_id ||
-               type > MM_DISPLAY_TYPE_OVERLAY_EXT) {
-               LOGE("invalid param %p %d %p %p", handle, type, display, parent_id);
+       if (!handle || type > MM_DISPLAY_TYPE_OVERLAY_EXT || !display) {
+               LOGE("invalid param (handle:%p, type:%d, display:%p)", handle, type, display);
+               return MM_ERROR_INVALID_ARGUMENT;
+       }
+       if ((type == MM_DISPLAY_TYPE_OVERLAY || type == MM_DISPLAY_TYPE_OVERLAY_EXT) && !parent_id) {
+               LOGE("parent_id is NULL");
                return MM_ERROR_INVALID_ARGUMENT;
        }