* xfont.c (xfont_open):
* xftfont.c (xftfont_open): All users changed.
+ * coding.c (ALLOC_CONVERSION_WORK_AREA): Prefer ptrdiff_t to int and
+ so avoid integer overflow if decoded gap size exceeds INT_MAX bytes.
+
2014-07-09 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (move_it_to): Adjust calculation of line_start_x to what
#define ALLOC_CONVERSION_WORK_AREA(coding, size) \
do { \
- int units = (size) + MAX_CHARBUF_EXTRA_SIZE; \
- \
- if (units > MAX_CHARBUF_SIZE) \
- units = MAX_CHARBUF_SIZE; \
- coding->charbuf = SAFE_ALLOCA ((units) * sizeof (int)); \
- coding->charbuf_size = (units); \
+ ptrdiff_t units = min ((size) + MAX_CHARBUF_EXTRA_SIZE, \
+ MAX_CHARBUF_SIZE); \
+ coding->charbuf = SAFE_ALLOCA (units * sizeof (int)); \
+ coding->charbuf_size = units; \
} while (0)
-
static void
produce_annotation (struct coding_system *coding, ptrdiff_t pos)
{