Are you sure that the texture you are settings is not NULL? Because if you SetBrushFromTexture with bMatchSize = true and Texture = NULL it will crash.
Are you sure that the texture you are settings is not NULL? Because if you SetBrushFromTexture with bMatchSize = true and Texture = NULL it will crash.