From 9eb4807f1fef0bd18ae11264ef79498371cf62ac Mon Sep 17 00:00:00 2001 From: Sejun Park Date: Tue, 25 Apr 2017 16:29:09 +0900 Subject: [PATCH] fixed build error and unresolved svace issues in unified version Change-Id: Idab4be2138bc8581eb4af0e3401ee9adad6f9a21 --- include/media_codec_port_gst.h | 3 ++- src/media_codec_port_gst.c | 10 +++++++--- test/media_codec_test.c | 14 ++++++++------ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/include/media_codec_port_gst.h b/include/media_codec_port_gst.h index d0aa50d..92b4eee 100755 --- a/include/media_codec_port_gst.h +++ b/include/media_codec_port_gst.h @@ -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; diff --git a/src/media_codec_port_gst.c b/src/media_codec_port_gst.c index cb8f751..95fac10 100755 --- a/src/media_codec_port_gst.c +++ b/src/media_codec_port_gst.c @@ -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; diff --git a/test/media_codec_test.c b/test/media_codec_test.c index e94e011..1f6096c 100755 --- a/test/media_codec_test.c +++ b/test/media_codec_test.c @@ -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(); } -- 2.7.4