fixed build error and unresolved svace issues in unified version 60/126860/1 submit/tizen/20170425.080426
authorSejun Park <sejun79.park@samsung.com>
Tue, 25 Apr 2017 07:29:09 +0000 (16:29 +0900)
committerSejun Park <sejun79.park@samsung.com>
Tue, 25 Apr 2017 07:29:09 +0000 (16:29 +0900)
Change-Id: Idab4be2138bc8581eb4af0e3401ee9adad6f9a21

include/media_codec_port_gst.h
src/media_codec_port_gst.c
test/media_codec_test.c

index d0aa50d..92b4eee 100755 (executable)
@@ -62,6 +62,7 @@ extern "C" {
 typedef struct _mc_gst_port_t mc_gst_port_t;
 typedef struct _mc_gst_core_t mc_gst_core_t;
 typedef struct _GstMCBuffer GstMCBuffer;
+typedef struct _ion_mmu_data_t ion_mmu_data_t;
 
 typedef enum {
        BUF_SHARE_METHOD_PADDR = 0,
@@ -71,7 +72,7 @@ typedef enum {
 } buf_share_method_t;
 
 #ifdef TIZEN_PROFILE_LITE
-struct ion_mmu_data {
+struct _ion_mmu_data_t {
        int master_id;
        int fd_buffer;
        unsigned long iova_addr;
index cb8f751..95fac10 100755 (executable)
@@ -2425,6 +2425,11 @@ static MMVideoBuffer *__mc_gst_make_tbm_buffer(mc_gst_core_t *core, media_packet
        int phy_addr = 0;
        int phy_size = 0;
        tbm_bo_handle handle_fd = tbm_bo_get_handle(mm_vbuffer->handle.bo[0], TBM_DEVICE_MM);
+       if (handle_fd == NULL) {
+               LOGE("Invaild bo handle");
+               return NULL;
+       }
+
        if (__tbm_get_physical_addr_bo(handle_fd, &phy_addr, &phy_size) == 0) {
                mm_vbuffer->handle.paddr[0] = (void *)phy_addr;
                LOGD("mm_vbuffer->paddr : %p", mm_vbuffer->handle.paddr[0]);
@@ -2743,11 +2748,10 @@ int __tbm_get_physical_addr_bo(tbm_bo_handle handle_bo, int *phy_addr, int *phy_
        int open_flags = O_RDWR;
        int ion_fd = -1;
 
-       struct ion_mmu_data mmu_data;
+       ion_mmu_data_t mmu_data;
        struct ion_custom_data  custom_data;
 
-       memset(&mmu_data, 0x0, sizeof(ion_mmu_data));
-       memset(&custom_data, 0x0, sizeof(ion_custom_data));
+       memset(&mmu_data, 0x0, sizeof(ion_mmu_data_t));
 
        mmu_data.fd_buffer = handle_bo.u32;
        custom_data.cmd = 4;
index e94e011..1f6096c 100755 (executable)
@@ -639,11 +639,6 @@ void mp3dec_extractor(App *app, unsigned char **data, int *size, bool *have_fram
                return;
        } else {
                layer = 4 - ((header >> 17) & 0x3);
-
-               if (layer < 1) {
-                       *have_frame = FALSE;
-                       return;
-               }
        }
 
        /* if it's an invalid bitrate */
@@ -783,6 +778,13 @@ void extract_input_aacdec_m4a_test(App * app, unsigned char **data, int *size, b
                read_size = readsize;
                app->offset += header_size + readsize;
 
+               if (app->offset > app->length) {
+                       read_size = 0;
+                       *have_frame = FALSE;
+                       g_print("[FAIL] offset error \n");
+                       return;
+               }
+
        } else {
                read_size = 0;
                g_print("[FAIL] Not found aac frame sync. \n");
@@ -1762,7 +1764,7 @@ static void interpret(char *cmd, App *app)
        {
                app->frame = atoi(cmd);
 
-               if (app->frame > 0)
+               if (app->frame > 0 && app->frame < 10)
                        _mediacodec_process_input(app);
                reset_menu_state();
        }