Sun Mar 5 01:07:05 2017 UTC ()
merge libXfont 1.5.2.


(mrg)
diff -r1.6 -r1.7 xsrc/external/mit/libXfont/dist/src/FreeType/ftfuncs.c
diff -r1.4 -r1.5 xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c
diff -r1.3 -r1.4 xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c
diff -r1.5 -r1.6 xsrc/external/mit/libXfont/dist/src/fc/fserve.c
diff -r1.7 -r1.8 xsrc/external/mit/libXfont/include/config.h

cvs diff -r1.6 -r1.7 xsrc/external/mit/libXfont/dist/src/FreeType/ftfuncs.c (expand / switch to unified diff)

--- xsrc/external/mit/libXfont/dist/src/FreeType/ftfuncs.c 2015/02/25 19:59:36 1.6
+++ xsrc/external/mit/libXfont/dist/src/FreeType/ftfuncs.c 2017/03/05 01:07:05 1.7
@@ -464,27 +464,27 @@ FreeTypeOpenInstance(FTInstancePtr *inst @@ -464,27 +464,27 @@ FreeTypeOpenInstance(FTInstancePtr *inst
464 return xrc; 464 return xrc;
465 } 465 }
466 ftrc = FT_Set_Pixel_Sizes(instance->face->face, xsize, ysize); 466 ftrc = FT_Set_Pixel_Sizes(instance->face->face, xsize, ysize);
467 } 467 }
468 if(ftrc != 0) { 468 if(ftrc != 0) {
469 FT_Done_Size(instance->size); 469 FT_Done_Size(instance->size);
470 free(instance); 470 free(instance);
471 return FTtoXReturnCode(ftrc); 471 return FTtoXReturnCode(ftrc);
472 } 472 }
473 473
474 if( FT_IS_SFNT( face->face ) ) { 474 if( FT_IS_SFNT( face->face ) ) {
475#if 1 475#if 1
476 FT_F26Dot6 tt_char_width, tt_char_height, tt_dim_x, tt_dim_y; 476 FT_F26Dot6 tt_char_width, tt_char_height, tt_dim_x, tt_dim_y;
477 FT_UInt nn; 477 FT_Int nn;
478 478
479 instance->strike_index=0xFFFFU; 479 instance->strike_index=0xFFFFU;
480 480
481 tt_char_width = (FT_F26Dot6)(trans->scale*(1<<6) + 0.5); 481 tt_char_width = (FT_F26Dot6)(trans->scale*(1<<6) + 0.5);
482 tt_char_height = (FT_F26Dot6)(trans->scale*(1<<6) + 0.5); 482 tt_char_height = (FT_F26Dot6)(trans->scale*(1<<6) + 0.5);
483 483
484 tt_dim_x = FLOOR64( ( tt_char_width * trans->xres + 36 ) / 72 + 32 ); 484 tt_dim_x = FLOOR64( ( tt_char_width * trans->xres + 36 ) / 72 + 32 );
485 tt_dim_y = FLOOR64( ( tt_char_height * trans->yres + 36 ) / 72 + 32 ); 485 tt_dim_y = FLOOR64( ( tt_char_height * trans->yres + 36 ) / 72 + 32 );
486 486
487 if ( tt_dim_x && !tt_dim_y ) 487 if ( tt_dim_x && !tt_dim_y )
488 tt_dim_y = tt_dim_x; 488 tt_dim_y = tt_dim_x;
489 else if ( !tt_dim_x && tt_dim_y ) 489 else if ( !tt_dim_x && tt_dim_y )
490 tt_dim_x = tt_dim_y; 490 tt_dim_x = tt_dim_y;
@@ -612,27 +612,27 @@ FreeTypeInstanceFindGlyph(unsigned idx_i @@ -612,27 +612,27 @@ FreeTypeInstanceFindGlyph(unsigned idx_i
612 } 612 }
613 613
614 if(*available == NULL) { 614 if(*available == NULL) {
615 *available = calloc(iceil(instance->nglyphs, FONTSEGMENTSIZE), 615 *available = calloc(iceil(instance->nglyphs, FONTSEGMENTSIZE),
616 sizeof(int *)); 616 sizeof(int *));
617 if(*available == NULL) 617 if(*available == NULL)
618 return AllocError; 618 return AllocError;
619 } 619 }
620 620
621 segment = ifloor(idx, FONTSEGMENTSIZE); 621 segment = ifloor(idx, FONTSEGMENTSIZE);
622 offset = idx - segment * FONTSEGMENTSIZE; 622 offset = idx - segment * FONTSEGMENTSIZE;
623 623
624 if((*available)[segment] == NULL) { 624 if((*available)[segment] == NULL) {
625 (*available)[segment] = calloc(FONTSEGMENTSIZE, sizeof(int *)); 625 (*available)[segment] = calloc(FONTSEGMENTSIZE, sizeof(int));
626 if((*available)[segment] == NULL) 626 if((*available)[segment] == NULL)
627 return AllocError; 627 return AllocError;
628 } 628 }
629 629
630 if(*glyphs == NULL) { 630 if(*glyphs == NULL) {
631 *glyphs = calloc(iceil(instance->nglyphs, FONTSEGMENTSIZE), 631 *glyphs = calloc(iceil(instance->nglyphs, FONTSEGMENTSIZE),
632 sizeof(CharInfoPtr)); 632 sizeof(CharInfoPtr));
633 if(*glyphs == NULL) 633 if(*glyphs == NULL)
634 return AllocError; 634 return AllocError;
635 } 635 }
636 636
637 if((*glyphs)[segment] == NULL) { 637 if((*glyphs)[segment] == NULL) {
638 (*glyphs)[segment] = malloc(sizeof(CharInfoRec) * FONTSEGMENTSIZE); 638 (*glyphs)[segment] = malloc(sizeof(CharInfoRec) * FONTSEGMENTSIZE);
@@ -1444,27 +1444,27 @@ FreeTypeRasteriseGlyph(unsigned idx, int @@ -1444,27 +1444,27 @@ FreeTypeRasteriseGlyph(unsigned idx, int
1444 bitmap = &face->face->glyph->bitmap; 1444 bitmap = &face->face->glyph->bitmap;
1445 if( 0 <= dx ){ 1445 if( 0 <= dx ){
1446 div_dx = dx / 8; 1446 div_dx = dx / 8;
1447 mod_dx0 = dx % 8; 1447 mod_dx0 = dx % 8;
1448 mod_dx1 = 8-mod_dx0; 1448 mod_dx1 = 8-mod_dx0;
1449 } 1449 }
1450 else{ 1450 else{
1451 div_dx = dx / 8 -1; 1451 div_dx = dx / 8 -1;
1452 mod_dx1 = -dx % 8; 1452 mod_dx1 = -dx % 8;
1453 mod_dx0 = 8-mod_dx1; 1453 mod_dx0 = 8-mod_dx1;
1454 } 1454 }
1455 for( i = MAX(0, dy) ; i<ht ; i++ ){ 1455 for( i = MAX(0, dy) ; i<ht ; i++ ){
1456 int prev_jj,jj; 1456 int prev_jj,jj;
1457 if( bitmap->rows <= i-dy ) break; 1457 if( bitmap->rows <= (unsigned) (i-dy) ) break;
1458 current_buffer=(unsigned char *)(bitmap->buffer+bitmap->pitch*(i-dy)); 1458 current_buffer=(unsigned char *)(bitmap->buffer+bitmap->pitch*(i-dy));
1459 current_raster=(unsigned char *)(raster+i*bpr); 1459 current_raster=(unsigned char *)(raster+i*bpr);
1460 j = MAX(0,div_dx); 1460 j = MAX(0,div_dx);
1461 jj = j-div_dx; 1461 jj = j-div_dx;
1462 prev_jj = jj-1; 1462 prev_jj = jj-1;
1463 if( j<bpr ){ 1463 if( j<bpr ){
1464 if( 0 <= prev_jj && prev_jj < bitmap->pitch ) 1464 if( 0 <= prev_jj && prev_jj < bitmap->pitch )
1465 current_raster[j]|=current_buffer[prev_jj]<<mod_dx1; 1465 current_raster[j]|=current_buffer[prev_jj]<<mod_dx1;
1466 if( 0 <= jj && jj < bitmap->pitch ){ 1466 if( 0 <= jj && jj < bitmap->pitch ){
1467 current_raster[j]|=current_buffer[jj]>>mod_dx0; 1467 current_raster[j]|=current_buffer[jj]>>mod_dx0;
1468 j++; prev_jj++; jj++; 1468 j++; prev_jj++; jj++;
1469 for( ; j<bpr ; j++,prev_jj++,jj++ ){ 1469 for( ; j<bpr ; j++,prev_jj++,jj++ ){
1470 current_raster[j]|=current_buffer[prev_jj]<<mod_dx1; 1470 current_raster[j]|=current_buffer[prev_jj]<<mod_dx1;
@@ -2051,58 +2051,58 @@ restrict_code_range_by_str(int count,uns @@ -2051,58 +2051,58 @@ restrict_code_range_by_str(int count,uns
2051 char const *str) 2051 char const *str)
2052{ 2052{
2053 int nRanges = 0; 2053 int nRanges = 0;
2054 int result = 0; 2054 int result = 0;
2055 fsRange *ranges = NULL, *oldRanges; 2055 fsRange *ranges = NULL, *oldRanges;
2056 char const *p, *q; 2056 char const *p, *q;
2057 2057
2058 p = q = str; 2058 p = q = str;
2059 for (;;) { 2059 for (;;) {
2060 int minpoint=0, maxpoint=65535; 2060 int minpoint=0, maxpoint=65535;
2061 long val; 2061 long val;
2062 2062
2063 /* skip comma and/or space */ 2063 /* skip comma and/or space */
2064 while (',' == *p || isspace(*p)) 2064 while (',' == *p || isspace((unsigned char)*p))
2065 p++; 2065 p++;
2066 2066
2067 /* begin point */ 2067 /* begin point */
2068 if ('-' != *p) { 2068 if ('-' != *p) {
2069 val = strtol(p, (char **)&q, 0); 2069 val = strtol(p, (char **)&q, 0);
2070 if (p == q) 2070 if (p == q)
2071 /* end or illegal */ 2071 /* end or illegal */
2072 break; 2072 break;
2073 if (val<0 || val>65535) { 2073 if (val<0 || val>65535) {
2074 /* out of zone */ 2074 /* out of zone */
2075 break; 2075 break;
2076 } 2076 }
2077 minpoint = val; 2077 minpoint = val;
2078 p=q; 2078 p=q;
2079 } 2079 }
2080 2080
2081 /* skip space */ 2081 /* skip space */
2082 while (isspace(*p)) 2082 while (isspace((unsigned char)*p))
2083 p++; 2083 p++;
2084 2084
2085 if (',' != *p && '\0' != *p) { 2085 if (',' != *p && '\0' != *p) {
2086 /* contiune */ 2086 /* contiune */
2087 if ('-' == *p) 2087 if ('-' == *p)
2088 /* hyphon */ 2088 /* hyphon */
2089 p++; 2089 p++;
2090 else 2090 else
2091 /* end or illegal */ 2091 /* end or illegal */
2092 break; 2092 break;
2093 2093
2094 /* skip space */ 2094 /* skip space */
2095 while (isspace(*p)) 2095 while (isspace((unsigned char)*p))
2096 p++; 2096 p++;
2097 2097
2098 val = strtol(p, (char **)&q, 0); 2098 val = strtol(p, (char **)&q, 0);
2099 if (p != q) { 2099 if (p != q) {
2100 if (val<0 || val>65535) 2100 if (val<0 || val>65535)
2101 break; 2101 break;
2102 maxpoint = val; 2102 maxpoint = val;
2103 } else if (',' != *p && '\0' != *p) 2103 } else if (',' != *p && '\0' != *p)
2104 /* end or illegal */ 2104 /* end or illegal */
2105 break; 2105 break;
2106 p=q; 2106 p=q;
2107 } else 2107 } else
2108 /* comma - single code */ 2108 /* comma - single code */
@@ -2975,33 +2975,33 @@ ft_compute_bounds(FTFontPtr font, FontIn @@ -2975,33 +2975,33 @@ ft_compute_bounds(FTFontPtr font, FontIn
2975 num_chars += num_cols; 2975 num_chars += num_cols;
2976 swidth += ABS(tmpchar->characterWidth)*num_cols; 2976 swidth += ABS(tmpchar->characterWidth)*num_cols;
2977 total_width += tmpchar->characterWidth*num_cols; 2977 total_width += tmpchar->characterWidth*num_cols;
2978 continue; 2978 continue;
2979 } 2979 }
2980 } 2980 }
2981 else skip_ok=0; 2981 else skip_ok=0;
2982 } 2982 }
2983 } 2983 }
2984 for (col = pinfo->firstCol; col <= pinfo->lastCol; col++) { 2984 for (col = pinfo->firstCol; col <= pinfo->lastCol; col++) {
2985 c = row<<8|col; 2985 c = row<<8|col;
2986 flags=0; 2986 flags=0;
2987 if ( !force_c_outside ) { 2987 if ( !force_c_outside ) {
2988 if ( c <= instance->ttcap.forceConstantSpacingEnd 2988 if ( (signed) c <= instance->ttcap.forceConstantSpacingEnd
2989 && instance->ttcap.forceConstantSpacingBegin <= c ) 2989 && instance->ttcap.forceConstantSpacingBegin <= (signed) c )
2990 flags|=FT_FORCE_CONSTANT_SPACING; 2990 flags|=FT_FORCE_CONSTANT_SPACING;
2991 } 2991 }
2992 else { /* for GB18030 proportional */ 2992 else { /* for GB18030 proportional */
2993 if ( c <= instance->ttcap.forceConstantSpacingEnd 2993 if ( (signed) c <= instance->ttcap.forceConstantSpacingEnd
2994 || instance->ttcap.forceConstantSpacingBegin <= c ) 2994 || instance->ttcap.forceConstantSpacingBegin <= (signed) c )
2995 flags|=FT_FORCE_CONSTANT_SPACING; 2995 flags|=FT_FORCE_CONSTANT_SPACING;
2996 } 2996 }
2997#if 0 2997#if 0
2998 fprintf(stderr, "comp_bounds: %x ->", c); 2998 fprintf(stderr, "comp_bounds: %x ->", c);
2999#endif 2999#endif
3000 if ( skip_ok == 0 || flags == 0 ){ 3000 if ( skip_ok == 0 || flags == 0 ){
3001 tmpchar=NULL; 3001 tmpchar=NULL;
3002#if 0 3002#if 0
3003 fprintf(stderr, "%x\n", c); 3003 fprintf(stderr, "%x\n", c);
3004#endif 3004#endif
3005 if( FreeTypeFontGetGlyphMetrics(c, flags, &tmpchar, font) != Successful ) 3005 if( FreeTypeFontGetGlyphMetrics(c, flags, &tmpchar, font) != Successful )
3006 continue; 3006 continue;
3007 } 3007 }

cvs diff -r1.4 -r1.5 xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c (expand / switch to unified diff)

--- xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c 2015/03/17 18:11:17 1.4
+++ xsrc/external/mit/libXfont/dist/src/bitmap/bdfread.c 2017/03/05 01:07:05 1.5
@@ -288,27 +288,27 @@ bdfReadCharacters(FontFilePtr file, Font @@ -288,27 +288,27 @@ bdfReadCharacters(FontFilePtr file, Font
288 bitmapFont->metrics = NULL; 288 bitmapFont->metrics = NULL;
289 ndx = 0; 289 ndx = 0;
290 290
291 line = bdfGetLine(file, lineBuf, BDFLINELEN); 291 line = bdfGetLine(file, lineBuf, BDFLINELEN);
292 292
293 if ((!line) || (sscanf((char *) line, "CHARS %d", &nchars) != 1)) { 293 if ((!line) || (sscanf((char *) line, "CHARS %d", &nchars) != 1)) {
294 bdfError("bad 'CHARS' in bdf file\n"); 294 bdfError("bad 'CHARS' in bdf file\n");
295 return (FALSE); 295 return (FALSE);
296 } 296 }
297 if (nchars < 1) { 297 if (nchars < 1) {
298 bdfError("invalid number of CHARS in BDF file\n"); 298 bdfError("invalid number of CHARS in BDF file\n");
299 return (FALSE); 299 return (FALSE);
300 } 300 }
301 if (nchars > INT32_MAX / sizeof(CharInfoRec)) { 301 if (nchars > (signed) (INT32_MAX / sizeof(CharInfoRec))) {
302 bdfError("Couldn't allocate pCI (%d*%d)\n", nchars, 302 bdfError("Couldn't allocate pCI (%d*%d)\n", nchars,
303 (int) sizeof(CharInfoRec)); 303 (int) sizeof(CharInfoRec));
304 goto BAILOUT; 304 goto BAILOUT;
305 } 305 }
306 ci = calloc(nchars, sizeof(CharInfoRec)); 306 ci = calloc(nchars, sizeof(CharInfoRec));
307 if (!ci) { 307 if (!ci) {
308 bdfError("Couldn't allocate pCI (%d*%d)\n", nchars, 308 bdfError("Couldn't allocate pCI (%d*%d)\n", nchars,
309 (int) sizeof(CharInfoRec)); 309 (int) sizeof(CharInfoRec));
310 goto BAILOUT; 310 goto BAILOUT;
311 } 311 }
312 bitmapFont->metrics = ci; 312 bitmapFont->metrics = ci;
313 313
314 if (bitmapExtra) { 314 if (bitmapExtra) {
@@ -416,27 +416,27 @@ bdfReadCharacters(FontFilePtr file, Font @@ -416,27 +416,27 @@ bdfReadCharacters(FontFilePtr file, Font
416/* 5/31/89 (ef) -- we should be able to ditch the character and recover */ 416/* 5/31/89 (ef) -- we should be able to ditch the character and recover */
417/* from all of these. */ 417/* from all of these. */
418 418
419 line = bdfGetLine(file, lineBuf, BDFLINELEN); 419 line = bdfGetLine(file, lineBuf, BDFLINELEN);
420 if ((!line) || (sscanf((char *) line, "DWIDTH %d %d", &wx, &wy) != 2)) { 420 if ((!line) || (sscanf((char *) line, "DWIDTH %d %d", &wx, &wy) != 2)) {
421 bdfError("bad 'DWIDTH'\n"); 421 bdfError("bad 'DWIDTH'\n");
422 goto BAILOUT; 422 goto BAILOUT;
423 } 423 }
424 if (wy != 0) { 424 if (wy != 0) {
425 bdfError("DWIDTH y value must be zero\n"); 425 bdfError("DWIDTH y value must be zero\n");
426 goto BAILOUT; 426 goto BAILOUT;
427 } 427 }
428 /* xCharInfo metrics are stored as INT16 */ 428 /* xCharInfo metrics are stored as INT16 */
429 if ((wx < 0) || (wx > INT16_MAX)) { 429 if ((wx < INT16_MIN) || (wx > INT16_MAX)) {
430 bdfError("character '%s' has out of range width, %d\n", 430 bdfError("character '%s' has out of range width, %d\n",
431 charName, wx); 431 charName, wx);
432 goto BAILOUT; 432 goto BAILOUT;
433 } 433 }
434 line = bdfGetLine(file, lineBuf, BDFLINELEN); 434 line = bdfGetLine(file, lineBuf, BDFLINELEN);
435 if ((!line) || (sscanf((char *) line, "BBX %d %d %d %d", &bw, &bh, &bl, &bb) != 4)) { 435 if ((!line) || (sscanf((char *) line, "BBX %d %d %d %d", &bw, &bh, &bl, &bb) != 4)) {
436 bdfError("bad 'BBX'\n"); 436 bdfError("bad 'BBX'\n");
437 goto BAILOUT; 437 goto BAILOUT;
438 } 438 }
439 if ((bh < 0) || (bw < 0)) { 439 if ((bh < 0) || (bw < 0)) {
440 bdfError("character '%s' has a negative sized bitmap, %dx%d\n", 440 bdfError("character '%s' has a negative sized bitmap, %dx%d\n",
441 charName, bw, bh); 441 charName, bw, bh);
442 goto BAILOUT; 442 goto BAILOUT;
@@ -621,27 +621,27 @@ bdfReadProperties(FontFilePtr file, Font @@ -621,27 +621,27 @@ bdfReadProperties(FontFilePtr file, Font
621 secondbuf[BDFLINELEN], 621 secondbuf[BDFLINELEN],
622 thirdbuf[BDFLINELEN]; 622 thirdbuf[BDFLINELEN];
623 unsigned char *line; 623 unsigned char *line;
624 unsigned char lineBuf[BDFLINELEN]; 624 unsigned char lineBuf[BDFLINELEN];
625 BitmapFontPtr bitmapFont = (BitmapFontPtr) pFont->fontPrivate; 625 BitmapFontPtr bitmapFont = (BitmapFontPtr) pFont->fontPrivate;
626 626
627 line = bdfGetLine(file, lineBuf, BDFLINELEN); 627 line = bdfGetLine(file, lineBuf, BDFLINELEN);
628 if (!line || !bdfIsPrefix(line, "STARTPROPERTIES")) { 628 if (!line || !bdfIsPrefix(line, "STARTPROPERTIES")) {
629 bdfError("missing 'STARTPROPERTIES'\n"); 629 bdfError("missing 'STARTPROPERTIES'\n");
630 return (FALSE); 630 return (FALSE);
631 } 631 }
632 if ((sscanf((char *) line, "STARTPROPERTIES %d", &nProps) != 1) || 632 if ((sscanf((char *) line, "STARTPROPERTIES %d", &nProps) != 1) ||
633 (nProps <= 0) || 633 (nProps <= 0) ||
634 (nProps > ((INT32_MAX / sizeof(FontPropRec)) - BDF_GENPROPS))) { 634 (nProps > (signed) ((INT32_MAX / sizeof(FontPropRec)) - BDF_GENPROPS))) {
635 bdfError("bad 'STARTPROPERTIES'\n"); 635 bdfError("bad 'STARTPROPERTIES'\n");
636 return (FALSE); 636 return (FALSE);
637 } 637 }
638 pFont->info.isStringProp = NULL; 638 pFont->info.isStringProp = NULL;
639 pFont->info.props = NULL; 639 pFont->info.props = NULL;
640 pFont->info.nprops = 0; 640 pFont->info.nprops = 0;
641 641
642 stringProps = malloc((nProps + BDF_GENPROPS) * sizeof(char)); 642 stringProps = malloc((nProps + BDF_GENPROPS) * sizeof(char));
643 pFont->info.isStringProp = stringProps; 643 pFont->info.isStringProp = stringProps;
644 if (stringProps == NULL) { 644 if (stringProps == NULL) {
645 bdfError("Couldn't allocate stringProps (%d*%d)\n", 645 bdfError("Couldn't allocate stringProps (%d*%d)\n",
646 (nProps + BDF_GENPROPS), (int) sizeof(Bool)); 646 (nProps + BDF_GENPROPS), (int) sizeof(Bool));
647 goto BAILOUT; 647 goto BAILOUT;

cvs diff -r1.3 -r1.4 xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c (expand / switch to unified diff)

--- xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c 2013/05/31 01:18:45 1.3
+++ xsrc/external/mit/libXfont/dist/src/bitmap/pcfread.c 2017/03/05 01:07:05 1.4
@@ -477,27 +477,26 @@ pcfReadFont(FontPtr pFont, FontFilePtr f @@ -477,27 +477,26 @@ pcfReadFont(FontPtr pFont, FontFilePtr f
477 if (!offsets) { 477 if (!offsets) {
478 pcfError("pcfReadFont(): Couldn't allocate offsets (%d*%d)\n", 478 pcfError("pcfReadFont(): Couldn't allocate offsets (%d*%d)\n",
479 nbitmaps, (int) sizeof(CARD32)); 479 nbitmaps, (int) sizeof(CARD32));
480 goto Bail; 480 goto Bail;
481 } 481 }
482 for (i = 0; i < nbitmaps; i++) { 482 for (i = 0; i < nbitmaps; i++) {
483 offsets[i] = pcfGetINT32(file, format); 483 offsets[i] = pcfGetINT32(file, format);
484 if (IS_EOF(file)) goto Bail; 484 if (IS_EOF(file)) goto Bail;
485 } 485 }
486 486
487 for (i = 0; i < GLYPHPADOPTIONS; i++) { 487 for (i = 0; i < GLYPHPADOPTIONS; i++) {
488 bitmapSizes[i] = pcfGetINT32(file, format); 488 bitmapSizes[i] = pcfGetINT32(file, format);
489 if (IS_EOF(file)) goto Bail; 489 if (IS_EOF(file)) goto Bail;
490 if (bitmapSizes[i] < 0) goto Bail; 
491 } 490 }
492 491
493 sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX(format)]; 492 sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX(format)];
494 /* guard against completely empty font */ 493 /* guard against completely empty font */
495 bitmaps = malloc(sizebitmaps ? sizebitmaps : 1); 494 bitmaps = malloc(sizebitmaps ? sizebitmaps : 1);
496 if (!bitmaps) { 495 if (!bitmaps) {
497 pcfError("pcfReadFont(): Couldn't allocate bitmaps (%d)\n", sizebitmaps ? sizebitmaps : 1); 496 pcfError("pcfReadFont(): Couldn't allocate bitmaps (%d)\n", sizebitmaps ? sizebitmaps : 1);
498 goto Bail; 497 goto Bail;
499 } 498 }
500 FontFileRead(file, bitmaps, sizebitmaps); 499 FontFileRead(file, bitmaps, sizebitmaps);
501 if (IS_EOF(file)) goto Bail; 500 if (IS_EOF(file)) goto Bail;
502 position += sizebitmaps; 501 position += sizebitmaps;
503 502

cvs diff -r1.5 -r1.6 xsrc/external/mit/libXfont/dist/src/fc/fserve.c (expand / switch to unified diff)

--- xsrc/external/mit/libXfont/dist/src/fc/fserve.c 2017/02/20 14:55:47 1.5
+++ xsrc/external/mit/libXfont/dist/src/fc/fserve.c 2017/03/05 01:07:05 1.6
@@ -621,28 +621,28 @@ fs_get_reply (FSFpePtr conn, int *error) @@ -621,28 +621,28 @@ fs_get_reply (FSFpePtr conn, int *error)
621 return 0; 621 return 0;
622 } 622 }
623 623
624 rep = (fsGenericReply *) buf; 624 rep = (fsGenericReply *) buf;
625 625
626 /* 626 /*
627 * Refuse to accept replies longer than a maximum reasonable length, 627 * Refuse to accept replies longer than a maximum reasonable length,
628 * before we pass to _fs_start_read, since it will try to resize the 628 * before we pass to _fs_start_read, since it will try to resize the
629 * incoming connection buffer to this size. Also avoids integer overflow 629 * incoming connection buffer to this size. Also avoids integer overflow
630 * on 32-bit systems. 630 * on 32-bit systems.
631 */ 631 */
632 if (rep->length > MAX_REPLY_LENGTH) 632 if (rep->length > MAX_REPLY_LENGTH)
633 { 633 {
634 ErrorF("fserve: reply length %d > MAX_REPLY_LENGTH, disconnecting" 634 ErrorF("fserve: reply length %ld > MAX_REPLY_LENGTH, disconnecting"
635 " from font server\n", rep->length); 635 " from font server\n", (long)rep->length);
636 _fs_connection_died (conn); 636 _fs_connection_died (conn);
637 *error = FSIO_ERROR; 637 *error = FSIO_ERROR;
638 return 0; 638 return 0;
639 } 639 }
640 640
641 ret = _fs_start_read (conn, rep->length << 2, &buf); 641 ret = _fs_start_read (conn, rep->length << 2, &buf);
642 if (ret != FSIO_READY) 642 if (ret != FSIO_READY)
643 { 643 {
644 *error = FSIO_BLOCK; 644 *error = FSIO_BLOCK;
645 return 0; 645 return 0;
646 } 646 }
647 647
648 *error = FSIO_READY; 648 *error = FSIO_READY;
@@ -2840,34 +2840,32 @@ _fs_client_access (FSFpePtr conn, pointe @@ -2840,34 +2840,32 @@ _fs_client_access (FSFpePtr conn, pointe
2840 freeac.id = cur->acid; 2840 freeac.id = cur->acid;
2841 freeac.length = sizeof (fsFreeACReq) >> 2; 2841 freeac.length = sizeof (fsFreeACReq) >> 2;
2842 _fs_add_req_log(conn, FS_FreeAC); 2842 _fs_add_req_log(conn, FS_FreeAC);
2843 _fs_write (conn, (char *) &freeac, sizeof (fsFreeACReq)); 2843 _fs_write (conn, (char *) &freeac, sizeof (fsFreeACReq));
2844 } 2844 }
2845 crac.reqType = FS_CreateAC; 2845 crac.reqType = FS_CreateAC;
2846 crac.num_auths = set_font_authorizations(&authorizations, &authlen, 2846 crac.num_auths = set_font_authorizations(&authorizations, &authlen,
2847 client); 2847 client);
2848 /* Work around bug in xfs versions up through modular release 1.0.8 2848 /* Work around bug in xfs versions up through modular release 1.0.8
2849 which rejects CreateAC packets with num_auths = 0 & authlen < 4 */ 2849 which rejects CreateAC packets with num_auths = 0 & authlen < 4 */
2850 if (crac.num_auths == 0) { 2850 if (crac.num_auths == 0) {
2851 authorizations = padding; 2851 authorizations = padding;
2852 authlen = 4; 2852 authlen = 4;
2853 } else { 
2854 authlen = (authlen + 3) & ~0x3; 
2855 } 2853 }
2856 crac.length = (sizeof (fsCreateACReq) + authlen) >> 2; 2854 crac.length = (sizeof (fsCreateACReq) + authlen) >> 2;
2857 crac.acid = cur->acid; 2855 crac.acid = cur->acid;
2858 _fs_add_req_log(conn, FS_CreateAC); 2856 _fs_add_req_log(conn, FS_CreateAC);
2859 _fs_write(conn, (char *) &crac, sizeof (fsCreateACReq)); 2857 _fs_write(conn, (char *) &crac, sizeof (fsCreateACReq));
2860 _fs_write(conn, authorizations, authlen); 2858 _fs_write_pad(conn, authorizations, authlen);
2861 /* ignore reply; we don't even care about it */ 2859 /* ignore reply; we don't even care about it */
2862 conn->curacid = 0; 2860 conn->curacid = 0;
2863 cur->auth_generation = client_auth_generation(client); 2861 cur->auth_generation = client_auth_generation(client);
2864 } 2862 }
2865 if (conn->curacid != cur->acid) 2863 if (conn->curacid != cur->acid)
2866 { 2864 {
2867 setac.reqType = FS_SetAuthorization; 2865 setac.reqType = FS_SetAuthorization;
2868 setac.pad = 0; 2866 setac.pad = 0;
2869 setac.length = sizeof (fsSetAuthorizationReq) >> 2; 2867 setac.length = sizeof (fsSetAuthorizationReq) >> 2;
2870 setac.id = cur->acid; 2868 setac.id = cur->acid;
2871 _fs_add_req_log(conn, FS_SetAuthorization); 2869 _fs_add_req_log(conn, FS_SetAuthorization);
2872 _fs_write(conn, (char *) &setac, sizeof (fsSetAuthorizationReq)); 2870 _fs_write(conn, (char *) &setac, sizeof (fsSetAuthorizationReq));
2873 conn->curacid = cur->acid; 2871 conn->curacid = cur->acid;

cvs diff -r1.7 -r1.8 xsrc/external/mit/libXfont/include/config.h (expand / switch to unified diff)

--- xsrc/external/mit/libXfont/include/config.h 2015/03/17 18:36:41 1.7
+++ xsrc/external/mit/libXfont/include/config.h 2017/03/05 01:07:05 1.8
@@ -65,45 +65,45 @@ @@ -65,45 +65,45 @@
65 */ 65 */
66#undef LT_OBJDIR 66#undef LT_OBJDIR
67 67
68/* Name of package */ 68/* Name of package */
69#define PACKAGE "libXfont" 69#define PACKAGE "libXfont"
70 70
71/* Define to the address where bug reports for this package should be sent. */ 71/* Define to the address where bug reports for this package should be sent. */
72#define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg" 72#define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg"
73 73
74/* Define to the full name of this package. */ 74/* Define to the full name of this package. */
75#define PACKAGE_NAME "libXfont" 75#define PACKAGE_NAME "libXfont"
76 76
77/* Define to the full name and version of this package. */ 77/* Define to the full name and version of this package. */
78#define PACKAGE_STRING "libXfont 1.5.1" 78#define PACKAGE_STRING "libXfont 1.5.2"
79 79
80/* Define to the one symbol short name of this package. */ 80/* Define to the one symbol short name of this package. */
81#define PACKAGE_TARNAME "libXfont" 81#define PACKAGE_TARNAME "libXfont"
82 82
83/* Define to the home page for this package. */ 83/* Define to the home page for this package. */
84#undef PACKAGE_URL 84#undef PACKAGE_URL
85 85
86/* Define to the version of this package. */ 86/* Define to the version of this package. */
87#define PACKAGE_VERSION "1.5.1" 87#define PACKAGE_VERSION "1.5.2"
88 88
89/* Major version of this package */ 89/* Major version of this package */
90#define PACKAGE_VERSION_MAJOR 1 90#define PACKAGE_VERSION_MAJOR 1
91 91
92/* Minor version of this package */ 92/* Minor version of this package */
93#define PACKAGE_VERSION_MINOR 5 93#define PACKAGE_VERSION_MINOR 5
94 94
95/* Patch version of this package */ 95/* Patch version of this package */
96#define PACKAGE_VERSION_PATCHLEVEL 1 96#define PACKAGE_VERSION_PATCHLEVEL 2
97 97
98/* Define to 1 if you have the ANSI C header files. */ 98/* Define to 1 if you have the ANSI C header files. */
99#define STDC_HEADERS 1 99#define STDC_HEADERS 1
100 100
101/* Support TCP socket connections */ 101/* Support TCP socket connections */
102#define TCPCONN 1 102#define TCPCONN 1
103 103
104/* Support UNIX socket connections */ 104/* Support UNIX socket connections */
105#define UNIXCONN 1 105#define UNIXCONN 1
106 106
107/* Enable extensions on AIX 3, Interix. */ 107/* Enable extensions on AIX 3, Interix. */
108#ifndef _ALL_SOURCE 108#ifndef _ALL_SOURCE
109# undef _ALL_SOURCE 109# undef _ALL_SOURCE
@@ -117,27 +117,27 @@ @@ -117,27 +117,27 @@
117# undef _POSIX_PTHREAD_SEMANTICS 117# undef _POSIX_PTHREAD_SEMANTICS
118#endif 118#endif
119/* Enable extensions on HP NonStop. */ 119/* Enable extensions on HP NonStop. */
120#ifndef _TANDEM_SOURCE 120#ifndef _TANDEM_SOURCE
121# undef _TANDEM_SOURCE 121# undef _TANDEM_SOURCE
122#endif 122#endif
123/* Enable general extensions on Solaris. */ 123/* Enable general extensions on Solaris. */
124#ifndef __EXTENSIONS__ 124#ifndef __EXTENSIONS__
125# undef __EXTENSIONS__ 125# undef __EXTENSIONS__
126#endif 126#endif
127 127
128 128
129/* Version number of package */ 129/* Version number of package */
130#define VERSION "1.5.1" 130#define VERSION "1.5.2"
131 131
132/* Support bdf format bitmap font files */ 132/* Support bdf format bitmap font files */
133#define XFONT_BDFFORMAT 1 133#define XFONT_BDFFORMAT 1
134 134
135/* Support bitmap font files */ 135/* Support bitmap font files */
136#define XFONT_BITMAP 1 136#define XFONT_BITMAP 1
137 137
138/* Support built-in fonts */ 138/* Support built-in fonts */
139#define XFONT_BUILTINS 1 139#define XFONT_BUILTINS 1
140 140
141/* Support the X Font Services Protocol */ 141/* Support the X Font Services Protocol */
142#define XFONT_FC 1 142#define XFONT_FC 1
143 143