Merge pull request #1163 from gabor-mezei-arm/bp228_buffer_sharing_copy_output_buffer

[Backport] Add allocate and copy style output buffer protection