I hope you allocate memory to hold the pixels! From what you’ve posted it does seem as though that may be the cause. You cant get a pointer to any of the buffers, and have to provide an array to copy the data into.
You may also want to grab the data as unsigned bytes rather than floats…(bit quicker, 75% less data to transfer, more accurate, no time spent changing the internal format to floats…)