Issue977

Title crash with memory corruption/double free
Priority important Status open
Assigned To Keywords
Linked issues Watchers

Submitted on 2022-01-21 16h47 by freem, last changed by freem.

Messages
Author: freem Date: 2022-01-21   16h47
Cloned and built 9937c9cae376f57772e3f8f48d8830a39d62e78e, enabling "Precache 
item graphics", restart the game: crash (memory corruption / double free).

OS: Debian amd64
CPU: Intel(R) Pentium(R) Gold G5500 CPU @ 3.80GHz
GPU: none (integrated one)

Overloading the environment variable "MESA_LOADER_DRIVER_OVERRIDE=i965" makes 
the 
game work.

Using this patch: 

```
diff --git a/src/open_gl.c b/src/open_gl.c
index 3dbece492..a48a59dca 100644
--- a/src/open_gl.c
+++ b/src/open_gl.c
@@ -233,7 +233,7 @@ void make_texture_out_of_surface(struct image *img)
 		glBufferData(GL_PIXEL_UNPACK_BUFFER, img->w*img->h*4, data_ptr, 
GL_STREAM_DRAW);
 	}
 
-	if (!GLEW_ARB_texture_non_power_of_two) {
+	if ( 1 || !GLEW_ARB_texture_non_power_of_two) {
 		// If the GPU does not support NPOT textures, create a larger 
texture
 		compute_POT_texture_dimensions(img);
 
```

Also makes thing work.
History
Date User Action Args
2022-01-21 16:47:57freemcreate