diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index 307f455c3..5d579585a 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -1343,7 +1343,7 @@ svga_init(const device_t *info, svga_t *svga, void *priv, int memsize, svga->vram_max = memsize; svga->vram_display_mask = svga->vram_mask = memsize - 1; svga->decode_mask = 0x7fffff; - svga->changedvram = calloc(memsize >> 12, 1); + svga->changedvram = calloc((memsize >> 12) + 1, 1); svga->recalctimings_ex = recalctimings_ex; svga->video_in = video_in; svga->video_out = video_out;