Commit 3bcb80f1 authored by ths's avatar ths
Browse files

Fix sector size overflow, by Herbert Xu.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2237 c046a42c-6fe2-441c-8c8c-71466251a162
parent a42aa815
...@@ -888,7 +888,7 @@ static void fdctrl_start_transfer (fdctrl_t *fdctrl, int direction) ...@@ -888,7 +888,7 @@ static void fdctrl_start_transfer (fdctrl_t *fdctrl, int direction)
fdctrl->data_len = fdctrl->fifo[8]; fdctrl->data_len = fdctrl->fifo[8];
} else { } else {
int tmp; int tmp;
fdctrl->data_len = 128 << fdctrl->fifo[5]; fdctrl->data_len = 128 << (fdctrl->fifo[5] > 7 ? 7 : fdctrl->fifo[5]);
tmp = (cur_drv->last_sect - ks + 1); tmp = (cur_drv->last_sect - ks + 1);
if (fdctrl->fifo[0] & 0x80) if (fdctrl->fifo[0] & 0x80)
tmp += cur_drv->last_sect; tmp += cur_drv->last_sect;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment