Unlike e.g.LoadFromHexString, MemoryBlock::copyFrom does not ensure the size of the MemoryBlock before doing a memcpy.
If there’s a good reason why it doesn’t can the doc at least make that really clear and jassert?
Thanks
Unlike e.g.LoadFromHexString, MemoryBlock::copyFrom does not ensure the size of the MemoryBlock before doing a memcpy.
If there’s a good reason why it doesn’t can the doc at least make that really clear and jassert?
Thanks
If you want a full copy, you can simply use the = operator.
The docs do make it clear that this case is handled:
https://docs.juce.com/master/classMemoryBlock.html#a31d3f1d7a0269229c5f0c36ab0b9dc40
numBytes how much to copy in (if this goes beyond the size of the memory block, it will be clipped so not to do anything nasty)
Ahh, so it does, Thanks.
Home schooling and reading docs properly is not quite going as well as I thought
Obviously the kids need to be reading the docs!