From: Jiyong Min Date: Mon, 26 Sep 2016 23:57:53 +0000 (+0900) Subject: Modify invalid conversion type and argument mismatch X-Git-Tag: submit/tizen/20160928.043825^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5df369d4876c9675d6a36fb9bfd20016c7f0ad82;p=platform%2Fcore%2Fmultimedia%2Fdcm-service.git Modify invalid conversion type and argument mismatch - PROBLEM build warning Change-Id: Ibc5da37d908d59d8cdcaca928af0e41a834d075f Signed-off-by: Jiyong Min --- diff --git a/libdcm-util/dcm_image_codec.cpp b/libdcm-util/dcm_image_codec.cpp index 54c553d..034beed 100755 --- a/libdcm-util/dcm_image_codec.cpp +++ b/libdcm-util/dcm_image_codec.cpp @@ -145,13 +145,14 @@ static int _dcm_rotate_image(const unsigned char *source, const dcm_image_format return DCM_SUCCESS; } -int _dcm_rotate_rgb(unsigned char *source, const unsigned int size, int format, unsigned int *ori_width, unsigned int *ori_height) +int _dcm_rotate_rgb(unsigned char *source, const unsigned long long *size, int format, unsigned int *ori_width, unsigned int *ori_height) { unsigned int dpp = 0; /* data per pixel */ unsigned int x = 0, y = 0; unsigned int i = 0; unsigned int width = 0, height = 0; unsigned char *temp_buf = NULL; + size_t _size = (size_t)*size; if (format == DCM_IMAGE_FORMAT_RGBA) { dpp = 4; @@ -162,13 +163,13 @@ int _dcm_rotate_rgb(unsigned char *source, const unsigned int size, int format, return DCM_ERROR_INVALID_PARAMETER; } - temp_buf = malloc(size); + temp_buf = (unsigned char*)malloc(_size); if (temp_buf == NULL) { dcm_error("Failed to allocate memory"); return DCM_ERROR_OUT_OF_MEMORY; } /* initialize */ - memset(temp_buf, 0x00, size); + memset(temp_buf, 0x00, _size); width = *ori_width; height = *ori_height; @@ -183,7 +184,7 @@ int _dcm_rotate_rgb(unsigned char *source, const unsigned int size, int format, } /* copy image from temp buffer to original buffer */ - memcpy(source, temp_buf, size); + memcpy(source, temp_buf, _size); DCM_SAFE_FREE(temp_buf); /* swap width & height due to rotate 90 degree */