A bitmap struct I translate in another function is set to NULL after the function returns

the function :

```cpp

HRESULT RessourcesLoader::decode(LPCWSTR name,ID2D1Bitmap* bitmap1) {
    int hr = S_OK;
    hr = LoadFile(name, bitmap1);
    assert(SUCCEEDED(hr));

    hr = rendertarget->CreateBitmapFromWicBitmap(wicConverter, NULL, &bitmap1);
    assert(SUCCEEDED(hr));

return hr;

```

called here :

```cpp

ID2D1Bitmap* bmp1=NULL;
ID2D1Bitmap* bmp2=NULL;

rl->decode(L"Menu_corner.png", bmp1);

rl->decode(L"Menu_side.png", bmp2);

```

(inside the function hr is S\_OK and the struct have all in it, once the function return the pointers are NULL)
is it a scope issue ?