The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

d/vive: Up max config z and json size, also tidy

+6 -4
+6 -4
src/xrt/drivers/vive/vive_protocol.c
··· 62 62 .unknown2 = 0x7c, 63 63 }; 64 64 65 + #define CONFIG_Z_MAX_SIZE (1024 * 16) 66 + #define CONFIG_JSON_MAX_SIZE (1024 * 64) 65 67 66 68 char * 67 69 vive_read_config(struct os_hid_device *hid_dev) ··· 83 85 .id = VIVE_CONFIG_READ_REPORT_ID, 84 86 }; 85 87 86 - unsigned char *config_z = U_TYPED_ARRAY_CALLOC(unsigned char, 4096); 88 + unsigned char *config_z = U_TYPED_ARRAY_CALLOC(unsigned char, CONFIG_Z_MAX_SIZE); 87 89 88 90 uint32_t count = 0; 89 91 do { ··· 100 102 return NULL; 101 103 } 102 104 103 - if (count + report.len > 4096) { 105 + if (count + report.len > CONFIG_Z_MAX_SIZE) { 104 106 U_LOG_E("Configuration data too large"); 105 107 free(config_z); 106 108 return NULL; ··· 110 112 count += report.len; 111 113 } while (report.len); 112 114 113 - unsigned char *config_json = U_TYPED_ARRAY_CALLOC(unsigned char, 32768); 115 + unsigned char *config_json = U_TYPED_ARRAY_CALLOC(unsigned char, CONFIG_JSON_MAX_SIZE); 114 116 115 117 z_stream strm = { 116 118 .next_in = config_z, 117 119 .avail_in = count, 118 120 .next_out = config_json, 119 - .avail_out = 32768, 121 + .avail_out = CONFIG_JSON_MAX_SIZE, 120 122 .zalloc = Z_NULL, 121 123 .zfree = Z_NULL, 122 124 .opaque = Z_NULL,