Add to check whether bitmap has been created successfully 48/158948/1
authorchanywa <cbible.kim@samsung.com>
Mon, 6 Nov 2017 04:50:04 +0000 (13:50 +0900)
committerchanywa <cbible.kim@samsung.com>
Mon, 6 Nov 2017 04:51:56 +0000 (13:51 +0900)
Change-Id: I72a8fcbd097b7640c221d60f4c707c40d0d5e06f

src/here_view_objects.cpp

index 9be5153ed1cdba48d905ca30a71139f7b03ba052..093807471d5caffbfbabfaba1739441bee2971b5 100644 (file)
@@ -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 */