X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fvideo.c;fp=src%2Fvideo.c;h=91f09f3155a43bdee34043cc16049b9824aedc73;hb=56d0fddeeaee0ecb56cddc09db44bb87bf011314;hp=9c77bba372b5344047a37d7b8d997da84fda41f6;hpb=773592751bbdef2f304725b24f620f89c9d4a5eb;p=dos_imgv diff --git a/src/video.c b/src/video.c index 9c77bba..91f09f3 100644 --- a/src/video.c +++ b/src/video.c @@ -6,6 +6,7 @@ #include "vbe.h" #include "vga.h" #include "util.h" +#include "chkalloc.h" #ifdef __WATCOMC__ #include @@ -61,7 +62,7 @@ int init_video(void) num_vmodes = 0; max_modes = 256; - if(!(vmodes = malloc(max_modes * sizeof *vmodes))) { + if(!(vmodes = chk_malloc(max_modes * sizeof *vmodes))) { fprintf(stderr, "failed to allocate video modes list\n"); return -1; } @@ -76,9 +77,9 @@ int init_video(void) if(num_vmodes >= max_modes) { int newmax = max_modes ? (max_modes << 1) : 16; - if(!(vmptr = realloc(vmodes, newmax * sizeof *vmodes))) { + if(!(vmptr = chk_realloc(vmodes, newmax * sizeof *vmodes))) { fprintf(stderr, "failed to grow video mode list (%d)\n", newmax); - free(vmodes); + chk_free(vmodes); return -1; } vmodes = vmptr; @@ -123,7 +124,7 @@ int init_video(void) void cleanup_video(void) { - free(vmodes); + chk_free(vmodes); } struct video_mode *video_modes(void) @@ -394,7 +395,7 @@ void set_msr(uint32_t msr, uint32_t low, uint32_t high); parm [ecx][eax][edx] #endif /* __WATCOMC__ */ - + #define MSR_MTRRCAP 0xfe #define MSR_MTRRDEFTYPE 0x2ff