Skip to content

Commit

Permalink
Get rid of UB when calculating tile target memory location
Browse files Browse the repository at this point in the history
  • Loading branch information
lpereira committed Jun 27, 2022
1 parent 879e973 commit 81a1cbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion platforms/msdos/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static inline void set_tile_full(uint8_t dst_x, uint8_t dst_y, uint8_t tile, int
{
static uint8_t __far *video_seg = (uint8_t __far *)0xa0000000;
uint8_t __far *video_seg_start =
&video_seg[320 * (int)dst_y * 8 + (int)dst_x * 8];
&video_seg[320 * (unsigned int)dst_y * 8 + (unsigned int)dst_x * 8];
const uint16_t offs = get_tile_offset(tile);
const uint16_t off_high = 8 * (offs >> 4);
const uint16_t off_low = 8 * (offs & 0xf);
Expand Down

0 comments on commit 81a1cbe

Please sign in to comment.