Skip to content
This repository has been archived by the owner on Jul 25, 2020. It is now read-only.

Commit

Permalink
Fix segfaults
Browse files Browse the repository at this point in the history
  • Loading branch information
kayahr committed Aug 20, 2012
1 parent 8052602 commit 6f28712
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/packfont/packfont.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ static void storeFontGlyph(wlImages font, int index, gdImagePtr image)
gdImageFilledRectangle(output, 0, 0, 8, 8, transparency);
gdImageCopyResampled(output, image, 0, 0, 0, 0, 8, 8, gdImageSX(image),
gdImageSY(image));

/* Copy pixels from image to pic */
for (y = 0; y < 8; y++)
{
for (x = 0; x < 8; x++)
{
color = gdImageGetPixel(output, x, y);
font->images[index]->pixels[y * 8 + x] = color < 16 ? color : color | 0xf0;
color = gdImageGetPixel(output, x, y);
font->images[index]->pixels[y * 8 + x] = color < 16 ? color : color | 0xf0;
}
}

Expand Down Expand Up @@ -219,7 +219,7 @@ static wlImages readFont(char *inputDir)
qsort(filenames, quantity, sizeof(char *), sortFilenames);

// Build the font
font = (wlImages) malloc(172 * sizeof(wlImage));
font = wlImagesCreate(172, 8, 8);
for (i = 0; i < 172; i++)
{
if (i < quantity)
Expand Down
2 changes: 1 addition & 1 deletion src/unpackfont/unpackfont.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static void writePngs(char *outputDir, wlImages font)
{
int i;
char *oldDir;
char filename[6];
char filename[8];

oldDir = getcwd(NULL, 0);
if (chdir(outputDir))
Expand Down

0 comments on commit 6f28712

Please sign in to comment.