handle->src = NULL;
if (media_packet_get_buffer_data_ptr(handle->src_packet, &handle->src) != MM_UTIL_ERROR_NONE) {
mm_util_error("[src] media_packet_get_extra");
- IMGP_FREE(handle->src);
return MM_UTIL_ERROR_INVALID_PARAMETER;
}
mm_util_debug("src buffer pointer: %p", handle->src);
if (handle->dst_buf_size) {
handle->dst = NULL;
if (media_packet_get_buffer_data_ptr(handle->dst_packet, &handle->dst) != MM_UTIL_ERROR_NONE) {
- IMGP_FREE(handle->src);
- IMGP_FREE(handle->dst);
mm_util_error("[dst] media_packet_get_extra");
return MM_UTIL_ERROR_INVALID_PARAMETER;
}
src_format = handle->src_format;
if (dst_buf[src_index] == NULL) {
mm_util_error("[multi func] memory allocation error");
- IMGP_FREE(handle->src);
- IMGP_FREE(handle->dst);
return MM_UTIL_ERROR_INVALID_OPERATION;
}
memcpy(dst_buf[src_index], handle->src, handle->src_buf_size);
dst_buf[dst_index] = g_malloc(dst_buf_size);
if (dst_buf[dst_index] == NULL) {
mm_util_error("[multi func] memory allocation error");
- IMGP_FREE(handle->src);
- IMGP_FREE(handle->dst);
__mm_destroy_temp_buffer(dst_buf);
return MM_UTIL_ERROR_INVALID_OPERATION;
}
ret = mm_util_crop_image(dst_buf[src_index], src_width, src_height, src_format,
handle->start_x, handle->start_y, &handle->dst_width, &handle->dst_height, dst_buf[dst_index]);
if (ret != MM_UTIL_ERROR_NONE) {
- IMGP_FREE(handle->src);
- IMGP_FREE(handle->dst);
__mm_destroy_temp_buffer(dst_buf);
mm_util_error("mm_util_crop_image failed");
return ret;
dst_buf[dst_index] = g_malloc(dst_buf_size);
if (dst_buf[dst_index] == NULL) {
mm_util_error("[multi func] memory allocation error");
- IMGP_FREE(handle->src);
- IMGP_FREE(handle->dst);
__mm_destroy_temp_buffer(dst_buf);
return MM_UTIL_ERROR_INVALID_OPERATION;
}
ret = mm_util_resize_image(dst_buf[src_index], src_width, src_height, src_format, dst_buf[dst_index], &handle->dst_width, &handle->dst_height);
if (ret != MM_UTIL_ERROR_NONE) {
- IMGP_FREE(handle->src);
- IMGP_FREE(handle->dst);
__mm_destroy_temp_buffer(dst_buf);
mm_util_error("mm_util_resize_image failed");
return ret;
dst_buf[dst_index] = g_malloc(dst_buf_size);
if (dst_buf[dst_index] == NULL) {
mm_util_error("[multi func] memory allocation error");
- IMGP_FREE(handle->src);
- IMGP_FREE(handle->dst);
__mm_destroy_temp_buffer(dst_buf);
return MM_UTIL_ERROR_INVALID_OPERATION;
}
ret = mm_util_convert_colorspace(dst_buf[src_index], src_width, src_height, src_format, dst_buf[dst_index], handle->dst_format);
if (ret != MM_UTIL_ERROR_NONE) {
- IMGP_FREE(handle->src);
- IMGP_FREE(handle->dst);
__mm_destroy_temp_buffer(dst_buf);
mm_util_error("mm_util_convert_colorspace failed");
return ret;
dst_buf[dst_index] = g_malloc(dst_buf_size);
if (dst_buf[dst_index] == NULL) {
mm_util_error("[multi func] memory allocation error");
- IMGP_FREE(handle->src);
- IMGP_FREE(handle->dst);
__mm_destroy_temp_buffer(dst_buf);
return MM_UTIL_ERROR_INVALID_OPERATION;
}
ret = mm_util_rotate_image(dst_buf[src_index], src_width, src_height, src_format, dst_buf[dst_index], &handle->dst_width, &handle->dst_height, handle->dst_rotation);
if (ret != MM_UTIL_ERROR_NONE) {
- IMGP_FREE(handle->src);
- IMGP_FREE(handle->dst);
__mm_destroy_temp_buffer(dst_buf);
mm_util_error("mm_util_rotate_image failed");
return ret;
if (ret != MM_UTIL_ERROR_NONE) {
mm_util_error("__mm_util_processing failed");
+ media_packet_destroy(handle->dst_packet);
+ handle->dst_packet = NULL;
return MM_UTIL_ERROR_INVALID_PARAMETER;
}