diff options
author | eunhae choi <eunhae1.choi@samsung.com> | 2016-11-25 02:45:59 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.vlan103.tizen.org> | 2016-11-25 02:46:00 -0800 |
commit | 0b5da73f708599a4cc1f1b10c7ee9f0b38f505ed (patch) | |
tree | d6e840d5f1af8d918008c9f2537b9ef04ec1c6f2 | |
parent | abe2bda1a6b578402898b6bd70adeff8dc603786 (diff) | |
parent | 6916e5345973f7c343b38b15d79597e269c15424 (diff) | |
download | libmm-player-0b5da73f708599a4cc1f1b10c7ee9f0b38f505ed.tar.gz libmm-player-0b5da73f708599a4cc1f1b10c7ee9f0b38f505ed.tar.bz2 libmm-player-0b5da73f708599a4cc1f1b10c7ee9f0b38f505ed.zip |
Merge "Fixed SVACE critical issues" into tizen_3.0
-rw-r--r-- | src/mm_player_capture.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mm_player_capture.c b/src/mm_player_capture.c index af6f117..514ab7a 100644 --- a/src/mm_player_capture.c +++ b/src/mm_player_capture.c @@ -279,6 +279,7 @@ __mmplayer_capture_thread(gpointer data) { mm_player_t* player = (mm_player_t*) data; MMMessageParamType msg = {0, }; + unsigned char * src_buffer = NULL; unsigned char * linear_y_plane = NULL; unsigned char * linear_uv_plane = NULL; int orientation = 0; @@ -307,7 +308,6 @@ __mmplayer_capture_thread(gpointer data) int linear_uv_plane_size; int width = player->captured.width[0]; int height = player->captured.height[0]; - unsigned char * src_buffer = NULL; linear_y_plane_size = (width * height); linear_uv_plane_size = (width * height / 2); @@ -357,22 +357,21 @@ __mmplayer_capture_thread(gpointer data) } else if (MM_PLAYER_COLORSPACE_NV12 == player->video_cs) { #define MM_ALIGN(x, a) (((x) +(a) - 1) & ~((a) - 1)) int ret = 0; - char *src_buffer = NULL; /* using original width otherwises, app can't know aligned to resize */ int width_align = player->captured.width[0]; int y_size = width_align * player->captured.height[0]; int uv_size = width_align * player->captured.height[1]; int src_buffer_size = y_size + uv_size; int i, j; - char*temp = NULL; - char*dst_buf = NULL; + unsigned char * temp = NULL; + unsigned char * dst_buf = NULL; if (!src_buffer_size) { LOGE("invalid data size"); goto ERROR; } - src_buffer = (char*) g_try_malloc(src_buffer_size); + src_buffer = (unsigned char*) g_try_malloc(src_buffer_size); if (!src_buffer) { msg.code = MM_ERROR_PLAYER_NO_FREE_SPACE; @@ -411,6 +410,9 @@ __mmplayer_capture_thread(gpointer data) LOGE("failed to convert nv12 linear"); goto ERROR; } + + /* clean */ + MMPLAYER_FREEIF(src_buffer); } ret = _mmplayer_get_video_rotate_angle((MMHandleType)player, &orientation); @@ -442,15 +444,13 @@ __mmplayer_capture_thread(gpointer data) //MMPLAYER_FREEIF(player->capture.data); continue; ERROR: + MMPLAYER_FREEIF(src_buffer); + MMPLAYER_FREEIF(player->captured.data[0]); + MMPLAYER_FREEIF(player->captured.data[1]); if (player->video_cs == MM_PLAYER_COLORSPACE_NV12_TILED) { /* clean */ MMPLAYER_FREEIF(linear_y_plane); MMPLAYER_FREEIF(linear_uv_plane); - MMPLAYER_FREEIF(player->captured.data[0]); - MMPLAYER_FREEIF(player->captured.data[1]); - } else if (MM_PLAYER_COLORSPACE_NV12 == player->video_cs) { - MMPLAYER_FREEIF(player->captured.data[0]); - MMPLAYER_FREEIF(player->captured.data[1]); } msg.union_type = MM_MSG_UNION_CODE; |