Skip to content

Commit

Permalink
Fixed bug #2641111: "Win32: Crash when launching with Shareware Doom"…
Browse files Browse the repository at this point in the history
… - caused by Material patch definitions for DOOMII confusing the material manager into trying to create new materials from incomplete definitions (a better mechanism for this is needed).
  • Loading branch information
danij committed Feb 26, 2009
1 parent cef0cc5 commit 6811805
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions doomsday/engine/portable/src/con_busy.c
Expand Up @@ -92,7 +92,7 @@ static DGLuint texScreenshot; // Captured screenshot of the latest frame.
* @return Return value of the worker.
*/
int Con_Busy(int flags, const char* taskName, busyworkerfunc_t worker,
void *workerData)
void* workerData)
{
int result = 0;

Expand All @@ -113,7 +113,7 @@ int Con_Busy(int flags, const char* taskName, busyworkerfunc_t worker,
{ // Take a copy of the task name.
size_t len = strlen(taskName);

busyTaskName = M_Calloc(len);
busyTaskName = M_Calloc(len + 1);
snprintf(busyTaskName, len, "%s", taskName);
}
Sys_Unlock(busy_Mutex);
Expand Down
8 changes: 4 additions & 4 deletions doomsday/engine/portable/src/p_materialmanager.c
Expand Up @@ -529,10 +529,10 @@ Con_Message("P_MaterialCreate: Warning, attempted to create material "
* A new material.
*/

// Sanity checks.
assert(tex != 0);
assert(width > 0);
assert(height > 0);
// Only create complete materials.
// \todo Doing this here isn't ideal.
if(tex == 0 || !(width > 0) || !(height > 0))
return NULL;

mat = createMaterial(width, height, flags, mnamespace, def, tex);

Expand Down

0 comments on commit 6811805

Please sign in to comment.