aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaroslav Hensl <jara@hensl.cz>2024-09-26 00:23:46 +0200
committerJaroslav Hensl <jara@hensl.cz>2024-09-26 00:23:46 +0200
commit370bc9a33893c474f36e171e05b5aa60885c8997 (patch)
treec504cd865f41e1479aacd122dbcd0ffec0c1c527
parentb5a7e91089671879227f4ce231cd06e9e6a24f18 (diff)
downloadvmdisp9x-370bc9a33893c474f36e171e05b5aa60885c8997.tar.gz
fix: dereferencing NULL pointer
-rw-r--r--makefile2
-rw-r--r--vxd_svga.c8
-rw-r--r--vxd_svga_mem.c11
3 files changed, 13 insertions, 8 deletions
diff --git a/makefile b/makefile
index 6e5a990..8e00191 100644
--- a/makefile
+++ b/makefile
@@ -12,7 +12,7 @@ OBJS += &
INCS = -I$(%WATCOM)\h\win -Iddk -Ivmware
-VER_BUILD = 83
+VER_BUILD = 84
FLAGS = -DDRV_VER_BUILD=$(VER_BUILD)
diff --git a/vxd_svga.c b/vxd_svga.c
index cdba998..7f95a44 100644
--- a/vxd_svga.c
+++ b/vxd_svga.c
@@ -63,7 +63,7 @@ BOOL CB_queue_check(SVGACBHeader *tracked);
*/
extern FBHDA_t *hda;
extern ULONG hda_sem;
-static SVGA_DB_t *svga_db = NULL;
+SVGA_DB_t *svga_db = NULL;
extern LONG fb_lock_cnt;
@@ -185,6 +185,8 @@ static void SVGA_DB_alloc()
svga_db->stat_regions_usage = 0;
}
+
+ dbg_printf("SVGA_DB alloc, mem_usage: %ld\n", svga_db->stat_regions_usage);
}
void SVGA_region_usage_reset()
@@ -1673,8 +1675,10 @@ void SVGA_ProcessCleanup(DWORD pid)
map_reset(svga_db->regions_map, id);
}
} // for
+
+ dbg_printf("Free - pid: %ld, used memory: %ld\n", pid, svga_db->stat_regions_usage);
} // db != NULL
-
+
End_Critical_Section();
}
diff --git a/vxd_svga_mem.c b/vxd_svga_mem.c
index 49e5188..17f0518 100644
--- a/vxd_svga_mem.c
+++ b/vxd_svga_mem.c
@@ -107,7 +107,7 @@ static DWORD phycache_enda = 0;
*/
extern FBHDA_t *hda;
extern ULONG hda_sem;
-static SVGA_DB_t *svga_db = NULL;
+extern SVGA_DB_t *svga_db;
extern LONG fb_lock_cnt;
@@ -921,7 +921,7 @@ BOOL SVGA_region_create(SVGA_region_info_t *rinfo)
svga_db->stat_regions_usage += rinfo->size;
-// dbg_printf(dbg_gmr_succ, rinfo->region_id, rinfo->size);
+ dbg_printf("More memory usage: %ld (+%ld)\n", svga_db->stat_regions_usage, rinfo->size);
Signal_Semaphore(mem_sem);
return TRUE;
@@ -936,10 +936,11 @@ void SVGA_region_free(SVGA_region_info_t *rinfo)
BOOL saved_in_cache;
BYTE *free_ptr = (BYTE*)rinfo->address;
- svga_db->stat_regions_usage -= rinfo->size;
-
Wait_Semaphore(mem_sem, 0);
-
+
+ svga_db->stat_regions_usage -= rinfo->size;
+ dbg_printf("Less memory usage: %ld (-%ld)\n", svga_db->stat_regions_usage, rinfo->size);
+
saved_in_cache = cache_insert(rinfo);
if(gb_support)