tdf#120703 PVS: GetBitmapBits does not return required buffer size

... unlike GetMetaFileBitsEx or GetEnhMetaFileBits, which are used
in the other branches. The implementation is trying to pass nullptr
to the function since commit 41e72962df83a410986fb48250aaaf1adc827c13

Just calculate the required buffer size using BITMAP struct filled
by GetObject call.

V575 The null pointer is passed into 'GetBitmapBits' function.
     Inspect the third argument.

Change-Id: I0d164694c99d805fd59b65ea1b4df4919a89e130
Reviewed-on: https://gerrit.libreoffice.org/70012
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx
index a8fad97..f1511d6 100644
--- a/embeddedobj/source/msole/olecomponent.cxx
+++ b/embeddedobj/source/msole/olecomponent.cxx
@@ -334,7 +334,13 @@
        else if ( aMedium.tymed == TYMED_GDI ) // Bitmap
        {
            aFormat = "image/x-MS-bmp";
            nBufSize = GetBitmapBits( aMedium.hBitmap, 0, nullptr );

            // Find out size of buffer: deprecated GetBitmapBits does not have a mode to return
            // required buffer size
            BITMAP aBmp;
            GetObjectW(aMedium.hBitmap, sizeof(aBmp), &aBmp);
            nBufSize = aBmp.bmWidthBytes * aBmp.bmHeight;

            pBuf.reset(new sal_Int8[nBufSize]);
            if ( nBufSize && nBufSize == sal::static_int_cast< ULONG >( GetBitmapBits( aMedium.hBitmap, nBufSize, pBuf.get() ) ) )
            {