Samsung Galaxy S4 stuck in boot-loop
Hi all, I recently got a second hand Samsung galaxy S4 (GT-I9505) as a gift from a friend. I realized it had a problem that every time I went on certain applications especially settings I'd get a warning saying 'Unfortunately,'said app(settings)' has stopped.' I decided to factory reset my phone using the 'volume up, home button and power key' and I also wiped cache and even rebooted it, yet the problem still persists. Now when I try to turn on my phone and I get onto the set-up page when I try to press next it says 'Unfortunately settings has stopped' and takes me back to the start which I believe is called a boot-loop, I'm not sure though. I'm not to sure how my friend managed to get the phone to this state before he gave it to me and I think it may have either been that he downloaded a faulty application or that he tried to update the phone and then this problem occurred. Now I'm not too experienced when it comes to Custom Roms and things but I heard there is a solution which requires you to press the volume down and power key in order to download a Custom Rom but I'm not sure how I'll download one without the help of my phone(which remains in the boot-loop). And I'm also 100% sure that no Roms have been downloaded on the phone ever.
Any help is appreciated. Thanks in advance