Fix array subscript is above array bounds 86/194686/2 accepted/tizen/4.0/unified/20181210.001928 submit/tizen_4.0/20181207.021757
authorjiyong.min <jiyong.min@samsung.com>
Fri, 7 Dec 2018 04:00:49 +0000 (13:00 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Fri, 7 Dec 2018 04:03:38 +0000 (04:03 +0000)
Change-Id: I783904d2d1e535623731c59c59eee3e2fa41d1a2

src/common/media-svc-util.c

index fc0ae7f..e9c7445 100755 (executable)
@@ -348,7 +348,7 @@ static int __media_svc_get_content_type_from_mime(const char *path, const char *
 
        /*in application type, exitst sound file ex) x-smafs, asf */
        if (*category & MEDIA_SVC_CATEGORY_ETC) {
-               int prefix_len = strlen(content_category[MEDIA_SVC_CATEGORY_ETC].content_type) + 1;
+               int prefix_len = strlen(content_category[3].content_type) + 1;
                char *ext = NULL;
 
                for (idx = 0; idx < SOUND_MIME_NUM; idx++) {
@@ -388,7 +388,7 @@ static int __media_svc_get_content_type_from_mime(const char *path, const char *
 
        /*check music file in sound files. */
        if (*category & MEDIA_SVC_CATEGORY_SOUND) {
-               int prefix_len = strlen(content_category[MEDIA_SVC_CATEGORY_SOUND].content_type) + 1;
+               int prefix_len = strlen(content_category[0].content_type) + 1;
 
                for (idx = 0; idx < MUSIC_MIME_NUM; idx++) {
                        if (strcmp(mimetype + prefix_len, music_mime_table[idx]) == 0) {