From: chanywa Date: Mon, 6 Nov 2017 04:50:04 +0000 (+0900) Subject: Add to check whether bitmap has been created successfully X-Git-Tag: submit/tizen/20171106.061233~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5edc7f3ef6d28bf33a1d29f6cec6f90915260bdf;p=platform%2Fcore%2Flocation%2Fmaps-plugin-here.git Add to check whether bitmap has been created successfully Change-Id: I72a8fcbd097b7640c221d60f4c707c40d0d5e06f --- diff --git a/src/here_view_objects.cpp b/src/here_view_objects.cpp index 9be5153..0938074 100644 --- a/src/here_view_objects.cpp +++ b/src/here_view_objects.cpp @@ -299,9 +299,14 @@ here_error_e HereViewObjects::__updateMarker(maps_view_object_h hMarker, GeoMapO _Util::ConvertRGBA2BGRA(dst, (unsigned)w, (unsigned)h); Bitmap bmp; - bmp.Construct((const unsigned char*)dst, nSize, Dimension(w, h)); + if (bmp.Construct((const unsigned char*)dst, nSize, Dimension(w, h)) != 0) { + MAPS_LOGE("Failed to construct a bitmap object"); + error = MAPS_ERROR_INVALID_OPERATION; + free(dst); + break; + } hereMarker->SetBitmap(bmp); - g_free(dst); + free(dst); /* position */