display: cirrus: check vga bits per pixel(bpp) value
commit4299b90e9ba9ce5ca9024572804ba751aa1a7e70
authorPrasad J Pandit <pjp@fedoraproject.org>
Tue, 18 Oct 2016 07:45:17 +0000 (18 13:15 +0530)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 5 Dec 2016 10:01:55 +0000 (5 11:01 +0100)
tree1ccd2cdab99576b791e53ad97f20a8cc9ae94984
parent2d1cd6c7a91a4beb99a0c3a21be529222a708545
display: cirrus: check vga bits per pixel(bpp) value

In Cirrus CLGD 54xx VGA Emulator, if cirrus graphics mode is VGA,
'cirrus_get_bpp' returns zero(0), which could lead to a divide
by zero error in while copying pixel data. The same could occur
via blit pitch values. Add check to avoid it.

Reported-by: Huawei PSIRT <psirt@huawei.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-id: 1476776717-24807-1-git-send-email-ppandit@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/display/cirrus_vga.c