RFE: qxl mask is sent as garbage when not used
Submitted by Yaniv Kaul
Assigned to Spice Bug List
Description
If mask is not used, instead of sending the type as 'none' or something (1 byte), we send garbage (memory is not even zero'ed), and the whole Mask structure (13 bytes). Waste.
The code (with my printf) from server/red_worker.c:
static void fill_mask(RedChannelClient *rcc, SpiceMarshaller *m, SpiceImage *mask_bitmap, Drawable *drawable) { DisplayChannel *display_channel = SPICE_CONTAINEROF(rcc->channel, DisplayChannel, common.base); DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
if (mask_bitmap && m) {
if (display_channel->common.worker->image_compression != SPICE_IMAGE_COMPRESS_OFF) {
spice_image_compression_t save_img_comp =
display_channel->common.worker->image_compression;
display_channel->common.worker->image_compression = SPICE_IMAGE_COMPRESS_OFF;
fill_bits(dcc, m, mask_bitmap, drawable, FALSE);
display_channel->common.worker->image_compression = save_img_comp;
} else {
fill_bits(dcc, m, mask_bitmap, drawable, FALSE);
}
} else {
red_printf("fill_mask not doing much");
}
}