Lines 42-47
Link Here
|
42 |
#include "picturestr.h" |
42 |
#include "picturestr.h" |
43 |
#include "glyphstr.h" |
43 |
#include "glyphstr.h" |
44 |
|
44 |
|
|
|
45 |
#if HAVE_STDINT_H |
46 |
#include <stdint.h> |
47 |
#elif !defined(UINT32_MAX) |
48 |
#define UINT32_MAX 0xffffffffU |
49 |
#endif |
50 |
|
45 |
/* |
51 |
/* |
46 |
* From Knuth -- a good choice for hash/rehash values is p, p-2 where |
52 |
* From Knuth -- a good choice for hash/rehash values is p, p-2 where |
47 |
* p and p-2 are both prime. These tables are sized to have an extra 10% |
53 |
* p and p-2 are both prime. These tables are sized to have an extra 10% |
Lines 626-633
AllocateGlyph (xGlyphInfo *gi, int fdepth)
Link Here
|
626 |
int size; |
632 |
int size; |
627 |
GlyphPtr glyph; |
633 |
GlyphPtr glyph; |
628 |
int i; |
634 |
int i; |
629 |
|
635 |
size_t padded_width; |
630 |
size = gi->height * PixmapBytePad (gi->width, glyphDepths[fdepth]); |
636 |
|
|
|
637 |
padded_width = PixmapBytePad (gi->width, glyphDepths[fdepth]); |
638 |
if (gi->height && padded_width > (UINT32_MAX - sizeof(GlyphRec))/gi->height) |
639 |
return 0; |
640 |
size = gi->height * padded_width; |
631 |
glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec)); |
641 |
glyph = (GlyphPtr) xalloc (size + sizeof (GlyphRec)); |
632 |
if (!glyph) |
642 |
if (!glyph) |
633 |
return 0; |
643 |
return 0; |