Fix array subscript is above array bounds 85/194685/2 accepted/tizen/unified/20190111.055201 submit/tizen/20190104.070559 submit/tizen/20190109.233706
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:02:56 +0000 (13:02 +0900)
Change-Id: I783904d2d1e535623731c59c59eee3e2fa41d1a2

src/common/media-svc-util.c

index 17badfe..ce3239e 100755 (executable)
@@ -346,7 +346,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++) {
@@ -386,7 +386,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) {