viewer.c: Fix a segfault when resizing the window.