Z_Free: memory block wrote past end

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Z_Free: memory block wrote past end

Post by CZghost »

I made an experimental map with custom sounds where I am testing different sample rates up to maximum 22050 Hz - how it sounds like in game. I made a simple boxed map with some pillars and arches above player, a sky on top, buttons and it targetted speakers around the map. I set up few weak lights and minimum light to make sure the rest of map in shadow won't be completely in dark. Then tried to make simple test compile - success.

But when it comes to load the compiled map in game, it returns to Windows with Z_Free: memory block wrote past end error. What does that mean? I included four bullets ammo boxes in corners leaving default settings and through target_give I force player to gain more 100 bullets (it was reduced from 200, to see if it will help, it didn't)
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Z_Free: memory block wrote past end

Post by obsidian »

Simple, it means the sample rate that you are using isn't supported.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: Z_Free: memory block wrote past end

Post by CZghost »

Okay, thank you. Maybe it might be just 11025 and 22050 Hz - I never overreach the maximum sample rate. I am using sounds with 8000 Hz and 16000 Hz sample rate. Those are maybe the ones that are not supported. So, here we are :D
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: Z_Free: memory block wrote past end

Post by CZghost »

So I reduced number of sample rates to only 2: 22050 Hz and 11025 Hz - I know Maxell did use 11025 Hz sample rates in his experimental School map (and his map Zastavka) - it did work. For me, it does not. Why? :( I edited sounds to use only 22050 and 11025 Hz sample rate, like Maxell did, but the error is still present :(

///EDIT: I tried out again pack custom assets in the pk3, tried to replace old pk3 with the new pk3, tried out including BSP inside pk3 and tried out launching it in clean installation, but no success. It should have much deeper meaning that error. What sample rates exactly Quake 3 does support? List. Is it anything up to 22050 Hz or only 22050 Hz or 22050 Hz plus half of it? Does that appy also to textures (bad JPEG format)?
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: Z_Free: memory block wrote past end

Post by CZghost »

Seems Quake 3 does not support grayscale textures :disgust: I have to choose always RGB workspace when saving JPEG and TGA textures... So it's working now...
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
dONKEY
Posts: 566
Joined: Mon Oct 15, 2001 7:00 am

Re: Z_Free: memory block wrote past end

Post by dONKEY »

There are plenty of grey scale maps out there. You can't use progressive jpg thpugh
User avatar
Eraser
Posts: 19174
Joined: Fri Dec 01, 2000 8:00 am

Re: Z_Free: memory block wrote past end

Post by Eraser »

Make sure your sounds are 8 bit mono files as well
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: Z_Free: memory block wrote past end

Post by CZghost »

I am using 16bit mono, and it works. I'm sure it's not much important how much bits the bit depth has, maybe maximum 16 bits per sample. For the textures: I am using always standard baseline JPG in Q3, but it was in Greyscale color workspace (so only 8 bits per pixel in shades of grey), this was that what caused the error as well. I need to check if the image is in RGB color workspace already and if not, force Photoshop to save with RGB information... It can be only grays, but it always needs to carry full color information in three bytes per pixel (in raw format), though they are all the same...
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
User avatar
Eraser
Posts: 19174
Joined: Fri Dec 01, 2000 8:00 am

Re: Z_Free: memory block wrote past end

Post by Eraser »

Does JPEG even support this? Isn't it always 24 bpp?
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: Z_Free: memory block wrote past end

Post by CZghost »

I'm sure it does. When I tried to reopen saved JPG file some had Grey as color workspace. Then I forced Photoshop to change workspace to RGB color and save again. Then tried to reopen it and it had correct workspace then... I just did not notice workspace change when pasted downloaded image. When pasting copied image which is black&white/grayscale - Photoshop automaticaly changes workspace to save the space - which I always forgot to check. Then saved image as JPEG (not for web, using standard Save as utility) - selecting quality to 8 (from 0 to 12; High) it didn't lose any details, though... I think it is maximum 24 bpp (JPEG do not support alpha channels), but I think I can save JPEG with indexed colors as well (will need to test this)... Quake 3, however, seems to support only RGB color workspace for textures.
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
User avatar
MKJ
Posts: 32581
Joined: Fri Nov 24, 2000 8:00 am

Re: Z_Free: memory block wrote past end

Post by MKJ »

CZghost wrote:but I think I can save JPEG with indexed colors as well .
no. jpgs are by definition not indexed.
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: Z_Free: memory block wrote past end

Post by CZghost »

If I can save 8bit JPEG grayscale image, why not 8bit JPEG colored image? With only 256 colors and of course without transparency.

/// EDIT: I checked Photoshop saving settings with indexed images - JPEG is missing. That leads me to believe that only one variant of 8bit JPEG is grayscale.
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
Martinus
Posts: 158
Joined: Mon Jun 17, 2013 11:37 am

Re: Z_Free: memory block wrote past end

Post by Martinus »

Because the JPEG is the devil's picture file format. >:)
[url=http://lvlworld.com/author/Martinus]My Quake 3 maps[/url]
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: Z_Free: memory block wrote past end

Post by CZghost »

I do not think so. It depends highly on compression settings (read quality). More quality => less compression => bigger size. For Quake 3 textures I would recommend saving via Save As dialog and set quality to Maximum (10-12), also Baseline Standard should be checked. Never save as Web picture...
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
Post Reply