Silence buffer overrun Coverity warning
This buffer overrun could happen if implementer forgets to fill pointer svga.set_clock, but calls VGA_SetClock with index out of bounds. Placing assert in here should clear out false positives detected by Coverity.
This commit is contained in:
parent
e2196a77e2
commit
cd93ea9507
1 changed files with 6 additions and 4 deletions
|
@ -128,11 +128,13 @@ void VGA_SetClock(Bitu which,Bitu target) {
|
|||
best.n = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Program the s3 clock chip */
|
||||
vga.s3.clk[which].m=best.m;
|
||||
vga.s3.clk[which].r=r;
|
||||
vga.s3.clk[which].n=best.n;
|
||||
constexpr size_t vga_s3_clk_len = sizeof(vga.s3.clk) / sizeof(*vga.s3.clk);
|
||||
assert(which < vga_s3_clk_len);
|
||||
vga.s3.clk[which].m = best.m;
|
||||
vga.s3.clk[which].r = r;
|
||||
vga.s3.clk[which].n = best.n;
|
||||
VGA_StartResize();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue