From c37882d16b6ade4504ac1f2aae2fe828875a4a86 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 25 Jul 2020 11:41:58 -0400 Subject: [PATCH] x11 utility tile name comparisons were checking against unitialized data --- win/X11/tile2x11.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/win/X11/tile2x11.c b/win/X11/tile2x11.c index 774b6e636..762f95ba2 100644 --- a/win/X11/tile2x11.c +++ b/win/X11/tile2x11.c @@ -22,6 +22,9 @@ unsigned char tile_bytes[TILE_X * TILE_Y * (MAX_GLYPH + TILES_PER_ROW)]; unsigned char *curr_tb = tile_bytes; unsigned char x11_colormap[MAXCOLORMAPSIZE][3]; +extern void NDECL(monst_globals_init); +extern void NDECL(objects_globals_init); + /* Look up the given pixel and return its colormap index. */ static unsigned char pix_to_colormap(pix) @@ -187,6 +190,10 @@ char **argv; exit(1); } + /* without this, the comparisons check uninitialized data and won't pass */ + objects_globals_init(); + monst_globals_init(); + fp = fopen(OUTNAME, "w"); if (!fp) { Fprintf(stderr, "can't open output file\n");