Default how to solve camera bug in most of the porting rom?

i face camera bug problem in most of time whenever i try to port rom from different mobiles