summaryrefslogtreecommitdiff
authorYonit Halperin <yhalperi@redhat.com>2012-11-28 19:04:11 (GMT)
committer Yonit Halperin <yhalperi@redhat.com>2012-11-28 19:04:11 (GMT)
commit1e6f872066cddf25e397e2cbaad9f4ab1b0c2de3 (patch) (side-by-side diff)
tree84d26a3262213130c23f5b60d2e3a0a5fced9d5c
parent4c1a2ad3f1b9d9ebdd578c5eaccf58ca845362fe (diff)
downloadspice-1e6f872066cddf25e397e2cbaad9f4ab1b0c2de3.zip
spice-1e6f872066cddf25e397e2cbaad9f4ab1b0c2de3.tar.gz
red_worker: fix sending internal images with stride > bpp*width to lz compression
rhbz#876685 The current lz implementation does not support such bitmaps. The following patch will actually prevent allocating stride > bpp*width for internal images.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--server/red_worker.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/server/red_worker.c b/server/red_worker.c
index 54cad53..9bab003 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -8607,20 +8607,20 @@ static void red_marshall_image(RedChannelClient *rcc, SpiceMarshaller *m, ImageI
comp_mode = display_channel->common.worker->image_compression;
- if ((comp_mode == SPICE_IMAGE_COMPRESS_AUTO_LZ) ||
- (comp_mode == SPICE_IMAGE_COMPRESS_AUTO_GLZ)) {
+ if (((comp_mode == SPICE_IMAGE_COMPRESS_AUTO_LZ) ||
+ (comp_mode == SPICE_IMAGE_COMPRESS_AUTO_GLZ)) && !_stride_is_extra(&bitmap)) {
+
if (BITMAP_FMT_HAS_GRADUALITY(item->image_format)) {
- if (!_stride_is_extra(&bitmap)) {
- BitmapGradualType grad_level;
- grad_level = _get_bitmap_graduality_level(display_channel->common.worker,
- &bitmap,
- worker->mem_slots.internal_groupslot_id);
- if (grad_level == BITMAP_GRADUAL_HIGH) {
- // if we use lz for alpha, the stride can't be extra
- lossy_comp = display_channel->enable_jpeg && item->can_lossy;
- } else {
- lz_comp = TRUE;
- }
+ BitmapGradualType grad_level;
+
+ grad_level = _get_bitmap_graduality_level(display_channel->common.worker,
+ &bitmap,
+ worker->mem_slots.internal_groupslot_id);
+ if (grad_level == BITMAP_GRADUAL_HIGH) {
+ // if we use lz for alpha, the stride can't be extra
+ lossy_comp = display_channel->enable_jpeg && item->can_lossy;
+ } else {
+ lz_comp = TRUE;
}
} else {
lz_comp = TRUE;