Hi,
Looks like there is some problem in allocating buffer. Please refer the following similar issue, which may help you.
Also, please refer the following sample.
Thank you.