Postby dkl » May 22, 2014 10:18
The image is only 50x50 - that's too small to hold an area of 101x101 pixels. As a result there will be a buffer overflow during the GET statement.
I'm wondering though why FB doesn't do the bound check... maybe it's because it just writes into the given buffer, without caring what it is or contains. "Get" also supports writing into arrays and it does have a bounds check for that. So, I wonder whether it could be changed to assume being given a properly initialized fb.Image buffer if it's not an array. It should be ok, because ImageCreate() is the only sane way to create the buffer for Get to write into, but who knows - old code may still be passing manually allocated uninitialized buffers.