Malware is a broad category which encompasses any software which may act contrary to the user’s demands. For this reason, various subcategories, including scamware and ransomware have been created over the years to more precisely define malware. Some viruses can be considered malware, if they were downloaded with some other stated intention.
Malware is short malicious software, and it is the malicious nature of it that defines it. Buggy software cannot rightly be considered malware, even if it has negative impacts on the user, because the creator did not intend for these problems to befall the user.