Number: 204
Title: VRML generation crashes
Submitter: Jonathan Segal
Date: Fri Sep 27 15:10:00 2002
Subsys: Neato
Version: 1.8.9
System: *-*-
Severity: minor
Problem:
If freetype is not available, generating vrml (-Tvrml) crashes neato with seg-fault.

I traced it to an erroneous call to gdImageString with a NULL image instead of the current image. I have attached a patch which fixes (or at least seems to fix) the problem.

(Note -- I have been working with my colleague Art Morales, who has reported this bug before, so you know about it -- I just traced and fixed it).

I have also implemented an enhancement which makes it easier to give the nodes thickness in 3D. Please let me know the best way to submit that patch for consideration.

Thanks, -Jonathan
Comments:
There isn't a file upload field for the "fix" section below -- please let me know if there were problems with my cut-and-paste of the patch.
Fix:


*** dotneato/common/vrmlgen.c	Fri Sep 27 14:15:00 2002
--- ../../graphviz-current/dotneato/common/vrmlgen.c	Mon Sep 16 16:14:33 2002
***************
*** 425,431 ****
  		ROUND(mp.x), ROUND(mp.y), line->str);
  	if (err) {
  		/* revert to builtin fonts */
! 		gdImageString(im, gdFontSmall, ROUND(mp.x), ROUND(mp.y),
                          (unsigned char *)line->str, cstk[SP].pencolor_ix);
  	}
  }
--- 425,431 ----
  		ROUND(mp.x), ROUND(mp.y), line->str);
  	if (err) {
  		/* revert to builtin fonts */
! 		gdImageString(NULL, gdFontSmall, ROUND(mp.x), ROUND(mp.y),
                          (unsigned char *)line->str, cstk[SP].pencolor_ix);
  	}
  }

Owner: ellson
Status: Fixed (27 September 2002)