mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 16:32:11 +01:00
Make imageviewer not segfault on XCB errors
Fixing the issue properly doesn't seem worth the effort, shared memory is ugly, and incremental loading is a lot of code. Xlib - XCB 1:0
This commit is contained in:
1 file changed
+8
-1
@@ -263,8 +263,15 @@ main(int argc, char** argv) {
|
||||
|
||||
while (true) {
|
||||
xcb_generic_event_t* event = xcb_wait_for_event(c);
|
||||
bool reload = false;
|
||||
// XXX: Large pictures may cause XCB_CONN_CLOSED_REQ_LEN_EXCEED because,
|
||||
// e.g., 4_194_303 * 4 = 16_777_212 = not nearly enough,
|
||||
// requiring some trickery to be uploaded to the server.
|
||||
if (!event) {
|
||||
printf("XCB failure (error code %d)\n", xcb_connection_has_error(c));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
bool reload = false;
|
||||
switch (event->response_type & 0x7F) {
|
||||
case XCB_EXPOSE: {
|
||||
xcb_expose_event_t* e = (xcb_expose_event_t*)event;
|
||||
|
||||
Reference in new issue
Block a user