Fix coverity issue 40/173140/3 accepted/tizen/unified/20180321.060755 submit/tizen/20180320.040253
authorJiyong Min <jiyong.min@samsung.com>
Tue, 20 Mar 2018 01:22:50 +0000 (10:22 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Tue, 20 Mar 2018 01:40:00 +0000 (10:40 +0900)
Change-Id: Id9b70015595a83cde4c6d67c77cf4d36132923b3

decode-test/image_util_decode_encode_testsuite.c
packaging/capi-media-image-util.spec
test/image_util_test.c

index afa4d09dfa5ae841445d62d72a105139be7fa6cc..6416cc31eb03fe403a551297f786c3827c12db73 100755 (executable)
@@ -118,7 +118,7 @@ static inline void flush_stdin()
        while ((ch = getchar()) != EOF && ch != '\n') ;
 }
 
-static gboolean _read_file(char *file_name, void **data, size_t *data_size)
+static gboolean _read_file(const char *file_name, void **data, size_t *data_size)
 {
        FILE *fp = NULL;
        long file_size = 0;
@@ -177,7 +177,7 @@ static gboolean _write_file(const char *file_name, void *data, size_t data_size)
 {
        FILE *fp = NULL;
 
-       if (!file_name || !data || data_size <= 0) {
+       if (!file_name || !data || data_size == 0) {
                fprintf(stderr, "\tinvalid data %s %p size:%zu\n", file_name, data, data_size);
                return FALSE;
        }
index 860678584e98a53f4fa0136875f8efdd99303eb7..1331f7a4ef09d804f9f520e7f66482288ac19d04 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-media-image-util
 Summary:    A Image Utility library in Tizen Native API
-Version:    0.1.37
+Version:    0.1.38
 Release:    2
 Group:      Multimedia/API
 License:    Apache-2.0
index c593fadfb57e2393f8adee0679b848e2c578ebcf..d75077e1a1689d20987f5960d8ed2c0d8c294b44 100755 (executable)
@@ -504,7 +504,7 @@ static void interpret_set_image_cmd(char *cmd)
                }
        } else if (g_menu_set_image_state == CURRENT_STATE_SET_IMAGE_PATH) {
                IMAGE_UTIL_SAFE_FREE(g_path);
-               g_path = (char *)g_malloc(MAX_STRING_LEN * sizeof(char *));
+               g_path = (char *)g_malloc(MAX_STRING_LEN * sizeof(char));
                if (g_path == NULL) {
                        g_printf("memory allocation fail. \n");
                        return;