src/hbcore/gui/hbsplash.cpp
changeset 21 4633027730f5
parent 5 627c4a0fd0e7
child 23 e6ad4ef83b23
--- a/src/hbcore/gui/hbsplash.cpp	Tue Jul 06 14:36:53 2010 +0300
+++ b/src/hbcore/gui/hbsplash.cpp	Wed Aug 18 10:05:37 2010 +0300
@@ -283,7 +283,8 @@
     TIpcArgs args(&oriDes, &appIdDes, &screenIdDes, &bitmapHandlePckg);
     if (SendReceive(HbSplashSrvGetSplashData, args) == KErrNone) {
         QScopedPointer<CFbsBitmap> bmp(new CFbsBitmap);
-        if (bmp->Duplicate(bitmapHandle) == KErrNone) {
+        TInt dupError = bmp->Duplicate(bitmapHandle);
+        if (dupError == KErrNone) {
             TSize size = bmp->SizeInPixels();
             TDisplayMode mode = bmp->DisplayMode();
             if (size.iWidth > 0 && size.iHeight > 0 && mode == EColor16MAP) {
@@ -299,7 +300,11 @@
                         data = new uchar[len];
                     }
                     if (data) {
-                        memcpy(data, bmp->DataAddress(), len);
+                        // The data copying cannot really be avoided here
+                        // because there is nobody to manage the CFbsBitmap
+                        // pointer and clients are typically interested in the
+                        // raw pixel data in a platform-independent form.
+                        qMemCopy(data, bmp->DataAddress(), len);
                         *params.w = size.iWidth;
                         *params.h = size.iHeight;
                         *params.bpl = bpl;
@@ -315,7 +320,8 @@
                          size.iWidth, size.iHeight, mode);
             }
         } else {
-            qWarning("[hbsplash] Cannot duplicate bitmap");
+            qWarning("[hbsplash] Cannot duplicate bitmap handle %d (%d)",
+                     bitmapHandle, dupError);
         }
     }
     return 0;